Handle failed openvzLocateConfDir.

* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID):
(openvzSetUUID): Don't dereference NULL upon failure.
This commit is contained in:
Jim Meyering 2008-02-21 18:22:45 +00:00
parent be8653b183
commit 5fc07cd840
2 changed files with 12 additions and 0 deletions

View File

@ -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.

View 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) {