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

login
register
mail settings
Submitter Stefan Hajnoczi
Date Jan. 30, 2013, 10:24 a.m.
Message ID <1359541470-30775-16-git-send-email-stefanha@redhat.com>
Download mbox | patch
Permalink /patch/216887/
State New
Headers show

Comments

Stefan Hajnoczi - Jan. 30, 2013, 10:24 a.m.
From: Markus Armbruster <armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@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;