]> xenbits.xensource.com Git - libvirt.git/commitdiff
virfile: Need to initialize 'looppath'
authorJohn Ferlan <jferlan@redhat.com>
Tue, 22 Jan 2013 14:15:43 +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.

src/util/virfile.c

index 50999aa0d34db90e552247a35d049bfb6769a1fe..5cca54df4ff4b73e91f6310cfd782860c9b655dd 100644 (file)
@@ -602,7 +602,7 @@ static int virFileLoopDeviceOpen(char **dev_name)
     int fd = -1;
     DIR *dh = NULL;
     struct dirent *de;
-    char *looppath;
+    char *looppath = NULL;
     struct loop_info64 lo;
 
     VIR_DEBUG("Looking for loop devices in /dev");