Patchwork [v2,07/11] qemu-log: Fix unchecked strdup() by converting to g_strdup()

login
register
mail settings
Submitter Markus Armbruster
Date Jan. 16, 2013, 5:32 p.m.
Message ID <1358357540-29862-8-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/213021/
State New
Headers show

Comments

Markus Armbruster - Jan. 16, 2013, 5:32 p.m.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 qemu-log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/qemu-log.c b/qemu-log.c
index b655b30..64a1b88 100644
--- a/qemu-log.c
+++ b/qemu-log.c
@@ -84,7 +84,7 @@  void qemu_set_log(int log_flags, bool use_own_buffers)
 
 void cpu_set_log_filename(const char *filename)
 {
-    logfilename = strdup(filename);
+    logfilename = g_strdup(filename);
     if (qemu_logfile) {
         fclose(qemu_logfile);
         qemu_logfile = NULL;