virFileNBDDeviceAssociate: Avoid use of uninitialized variable
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Sep 2013 16:56:06 +0000 (18:56 +0200)
committerEric Blake <eblake@redhat.com>
Wed, 4 Sep 2013 19:09:19 +0000 (13:09 -0600)
The @qemunbd variable can be used uninitialized.

(cherry picked from commit 2dba0323ff0cec31bdcea9dd3b2428af297401f2)

src/util/virfile.c

index e986ee7..e0b71ed 100644 (file)
@@ -738,7 +738,7 @@ int virFileNBDDeviceAssociate(const char *file,
                               char **dev)
 {
     char *nbddev;
-    char *qemunbd;
+    char *qemunbd = NULL;
     virCommandPtr cmd = NULL;
     int ret = -1;
     const char *fmtstr = NULL;