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:
parent
bc4486fb23
commit
0f516ca476
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user