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>
This commit is contained in:
Robert Foley 2019-11-18 16:15:23 -05:00 committed by Alex Bennée
parent bc4486fb23
commit 0f516ca476

View 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) {