]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
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:13:30 +0000 (13:13 -0600)
The @qemunbd variable can be used uninitialized.

(cherry picked from commit 2dba0323ff0cec31bdcea9dd3b2428af297401f2)

src/util/virfile.c

index ad0184500ea291d9aae795f2b11e8aac17b235f3..458d346cc5de0275f9bf046a1945b104bb58eeb1 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;