]> Git Repo - qemu.git/commitdiff
Fix double free issue in qemu_set_log_filename().
authorRobert Foley <[email protected]>
Mon, 18 Nov 2019 21:15:23 +0000 (16:15 -0500)
committerAlex Bennée <[email protected]>
Wed, 18 Dec 2019 20:18:02 +0000 (20:18 +0000)
After freeing the logfilename, we set logfilename to NULL, in case of an
error which returns without setting logfilename.

Signed-off-by: Robert Foley <[email protected]>
Reviewed-by: Alex Bennée <[email protected]>
Signed-off-by: Alex Bennée <[email protected]>
Message-Id: <20191118211528[email protected]>

util/log.c

index 1ca13059eef5441dce01769e046d455acf52af3b..4316fe74eee8ba96fd2d3c9afd3bf8b60e9cd39e 100644 (file)
@@ -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) {
This page took 0.026325 seconds and 4 git commands to generate.