]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Need to intialize 'str'
authorJohn Ferlan <jferlan@redhat.com>
Tue, 22 Jan 2013 14:15:45 +0000 (09:15 -0500)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 22 Jan 2013 16:29:26 +0000 (17:29 +0100)
It was possible to call VIR_FREE in error prior to initialization.

tools/virsh.c

index 908c6a117d33e644c3aee65af790b954f8ac20c6..27ed51173afd1f481b2b649a29c69d54d4b9d88f 100644 (file)
@@ -2268,7 +2268,7 @@ vshOutputLogFile(vshControl *ctl, int log_level, const char *msg_format,
                  va_list ap)
 {
     virBuffer buf = VIR_BUFFER_INITIALIZER;
-    char *str;
+    char *str = NULL;
     size_t len;
     const char *lvl = "";
     time_t stTime;