]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
openvz_conf.c: don't dereference NULL upon failure
authorJim Meyering <meyering@redhat.com>
Tue, 15 Dec 2009 15:16:57 +0000 (16:16 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 5 Jan 2010 14:32:53 +0000 (15:32 +0100)
* src/openvz/openvz_conf.c (openvzLoadDomains): Avoid NULL deref
of "dom".

src/openvz/openvz_conf.c

index 7e9abbfdab35824244026accc4e48b488131faf0..43bbaf24cb8f60e0364514d77bb0593c47a5365a 100644 (file)
@@ -535,7 +535,8 @@ int openvzLoadDomains(struct openvz_driver *driver) {
 
  cleanup:
     fclose(fp);
-    virDomainObjUnref(dom);
+    if (dom)
+        virDomainObjUnref(dom);
     return -1;
 }