From: Robert Foley Date: Mon, 18 Nov 2019 21:15:23 +0000 (-0500) Subject: Fix double free issue in qemu_set_log_filename(). X-Git-Tag: v4.2.1~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=45b65bf8dfb46a03ff67c36424986e2450c5203e;p=thirdparty%2Fqemu.git 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 Reviewed-by: Alex Bennée Signed-off-by: Alex Bennée Message-Id: <20191118211528.3221-2-robert.foley@linaro.org> (cherry picked from commit 0f516ca4767042aec8716369d6d62436fa10593a) Signed-off-by: Michael Roth --- diff --git a/util/log.c b/util/log.c index 1ca13059eef..4316fe74eee 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) {