From: Jim Meyering Date: Tue, 15 Dec 2009 15:16:57 +0000 (+0100) Subject: openvz_conf.c: don't dereference NULL upon failure X-Git-Tag: v0.7.6~240 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1237818d26ac7a7c50e87b441c8f90c44535a74;p=thirdparty%2Flibvirt.git openvz_conf.c: don't dereference NULL upon failure * src/openvz/openvz_conf.c (openvzLoadDomains): Avoid NULL deref of "dom". --- diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index 7e9abbfdab..43bbaf24cb 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -535,7 +535,8 @@ int openvzLoadDomains(struct openvz_driver *driver) { cleanup: fclose(fp); - virDomainObjUnref(dom); + if (dom) + virDomainObjUnref(dom); return -1; }