]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Handle failed openvzLocateConfDir.
authorJim Meyering <meyering@redhat.com>
Thu, 21 Feb 2008 18:22:45 +0000 (18:22 +0000)
committerJim Meyering <meyering@redhat.com>
Thu, 21 Feb 2008 18:22:45 +0000 (18:22 +0000)
* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
(openvzSetUUID): Don't dereference NULL upon failure.

ChangeLog
src/openvz_conf.c

index 84d3e9d91cc1a2e37160d14424b5e03d59889616..54ac292ee4a95a3ab44b52978ea5cb68d8ae9e03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Feb 21 19:22:10 CET 2008 Jim Meyering <meyering@redhat.com>
+
+       Handle failed openvzLocateConfDir.
+       * src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
+       (openvzSetUUID): Don't dereference NULL upon failure.
+
 Thu Feb 21 15:17:00 UTC 2008 Richard W.M. Jones <rjones@redhat.com>
 
        Fix double-free in OpenVZ driver.
index 0bc7084b901258e53debdf4bf5d3c88272564c97..79d1e90f564b6bb7dfca2ba4abf0bf26008fd544 100644 (file)
@@ -638,6 +638,8 @@ openvzGetVPSUUID(int vpsid, char *uuidstr)
     int fd, ret;
 
     conf_dir = openvzLocateConfDir();
+    if (conf_dir == NULL)
+        return -1;
     sprintf(conf_file, "%s/%d.conf", conf_dir, vpsid);
     free(conf_dir);
 
@@ -678,6 +680,8 @@ openvzSetUUID(int vpsid)
     int fd, ret;
 
     conf_dir = openvzLocateConfDir();
+    if (conf_dir == NULL)
+        return -1;
     sprintf(conf_file, "%s/%d.conf", conf_dir, vpsid);
     free(conf_dir);
 
@@ -719,6 +723,8 @@ int openvzAssignUUIDs(void)
     char ext[8];
 
     conf_dir = openvzLocateConfDir();
+    if (conf_dir == NULL)
+        return -1;
 
     dp = opendir(conf_dir);
     if(dp == NULL) {