diff options
author | Alexander Goncharov <chat@joursoir.net> | 2022-05-14 23:42:33 +0300 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-05-17 22:00:15 +0000 |
commit | 2d9d88ed6c96f03724bc77fdeee04b9f6b8b68de (patch) | |
tree | 51b1354e2923d43efa1f79eb4cbea43ad47eba76 | |
parent | dc6f7fb0a5189b6f5fdfe3084a2b243bd6c6c64d (diff) | |
download | flashrom-2d9d88ed6c96f03724bc77fdeee04b9f6b8b68de.tar.gz flashrom-2d9d88ed6c96f03724bc77fdeee04b9f6b8b68de.tar.bz2 flashrom-2d9d88ed6c96f03724bc77fdeee04b9f6b8b68de.zip |
cli_classic: fix memory leak
If parameter --wp-region is used and wp_region is allocated,
free the last one at the exit of the application.
Found-by: scan-build, clang v13.0.1
Signed-off-by: Alexander Goncharov <chat@joursoir.net>
Change-Id: I8520e302e9d63ed1215c5d9beb90a93fb52a91fe
Reviewed-on: https://review.coreboot.org/c/flashrom/+/64351
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Nikolai Artemiev <nartemiev@google.com>
-rw-r--r-- | cli_classic.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cli_classic.c b/cli_classic.c index 95430098..83ac5383 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -1100,6 +1100,7 @@ out: free(referencefile); free(layoutfile); free(pparam); + free(wp_region); /* clean up global variables */ free((char *)chip_to_probe); /* Silence! Freeing is not modifying contents. */ chip_to_probe = NULL; |