HAOUAS Elyes has uploaded this change for review.

View Change

cli_classic: Fix Memory leak

Found-by scan-build: 7.0.1-8
Change-Id: I84e642b57b95953f376569e443ef8d8eda7bf98f
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
---
M cli_classic.c
1 file changed, 5 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/05/34405/1
diff --git a/cli_classic.c b/cli_classic.c
index b79f953..19d65cc 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -383,6 +383,11 @@
fprintf(stderr, "Log file not supported in standalone mode. Aborting.\n");
cli_classic_abort_usage();
#else /* STANDALONE */
+ if (logfile[0] != '\0') {
+ fprintf(stderr, "Warning: log file not free of older string. Running free() rightnow.\n");
+ free(logfile);
+ }
+
logfile = strdup(optarg);
if (logfile[0] == '\0') {
fprintf(stderr, "No log filename specified.\n");

To view, visit change 34405. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I84e642b57b95953f376569e443ef8d8eda7bf98f
Gerrit-Change-Number: 34405
Gerrit-PatchSet: 1
Gerrit-Owner: HAOUAS Elyes <ehaouas@noos.fr>
Gerrit-MessageType: newchange