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

tests/virnetsockettest.c

index b968973c02b8cb44eddc572a06f9fe24e32dcd10..aaa6acb6bb95e37c35e119c21f3ad4eb43f33b40 100644 (file)
@@ -207,7 +207,7 @@ static int testSocketUNIXAccept(const void *data ATTRIBUTE_UNUSED)
     virNetSocketPtr csock = NULL; /* Client socket */
     int ret = -1;
 
-    char *path;
+    char *path = NULL;
     char *tmpdir;
     char template[] = "/tmp/libvirt_XXXXXX";
 
@@ -257,7 +257,7 @@ static int testSocketUNIXAddrs(const void *data ATTRIBUTE_UNUSED)
     virNetSocketPtr csock = NULL; /* Client socket */
     int ret = -1;
 
-    char *path;
+    char *path = NULL;
     char *tmpdir;
     char template[] = "/tmp/libvirt_XXXXXX";