diff options
author | Robert Foley <robert.foley@linaro.org> | 2019-11-18 16:15:23 -0500 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2019-12-18 20:18:02 +0000 |
commit | 0f516ca4767042aec8716369d6d62436fa10593a (patch) | |
tree | d9e1825157b43429b55c849092fe273ea997a0d9 /util/log.c | |
parent | bc4486fb233573e77b6e9ad6d6379afb5e37ad8c (diff) |
Fix double free issue in qemu_set_log_filename().
After freeing the logfilename, we set logfilename to NULL, in case of an
error which returns without setting logfilename.
Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20191118211528.3221-2-robert.foley@linaro.org>
Diffstat (limited to 'util/log.c')
-rw-r--r-- | util/log.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/util/log.c b/util/log.c index 1ca13059ee..4316fe74ee 100644 --- a/util/log.c +++ b/util/log.c @@ -113,6 +113,7 @@ void qemu_set_log_filename(const char *filename, Error **errp) { char *pidstr; g_free(logfilename); + logfilename = NULL; pidstr = strstr(filename, "%"); if (pidstr) { |