[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/6] Fix double free issue in qemu_set_log_filename().
From: |
Robert Foley |
Subject: |
[PATCH v2 1/6] Fix double free issue in qemu_set_log_filename(). |
Date: |
Fri, 15 Nov 2019 08:10:35 -0500 |
After freeing the logfilename, we set logfilename to NULL, in case of an
error which returns without setting logfilename.
Signed-off-by: Robert Foley <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
---
v2
- moved this change to the beginning of the patch series.
---
v1
- This is new in the patch v1.
---
util/log.c | 1 +
1 file changed, 1 insertion(+)
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) {
--
2.17.1
- [PATCH v2 0/6] Make the qemu_logfile handle thread safe., Robert Foley, 2019/11/15
- [PATCH v2 1/6] Fix double free issue in qemu_set_log_filename().,
Robert Foley <=
- [PATCH v2 3/6] Add a mutex to guarantee single writer to qemu_logfile handle., Robert Foley, 2019/11/15
- [PATCH v2 2/6] Cleaned up flow of code in qemu_set_log(), to simplify and clarify., Robert Foley, 2019/11/15
- [PATCH v2 4/6] qemu_log_lock/unlock now preserves the qemu_logfile handle., Robert Foley, 2019/11/15
- [PATCH v2 5/6] Add use of RCU for qemu_logfile., Robert Foley, 2019/11/15