mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-29 17:33:09 +00:00
Handle failed openvzLocateConfDir.
* src/openvz_conf.c (openvzLocateConfDir, openvzGetVPSUUID): (openvzSetUUID): Don't dereference NULL upon failure.
This commit is contained in:
parent
be8653b183
commit
5fc07cd840
@ -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>
|
Thu Feb 21 15:17:00 UTC 2008 Richard W.M. Jones <rjones@redhat.com>
|
||||||
|
|
||||||
Fix double-free in OpenVZ driver.
|
Fix double-free in OpenVZ driver.
|
||||||
|
@ -638,6 +638,8 @@ openvzGetVPSUUID(int vpsid, char *uuidstr)
|
|||||||
int fd, ret;
|
int fd, ret;
|
||||||
|
|
||||||
conf_dir = openvzLocateConfDir();
|
conf_dir = openvzLocateConfDir();
|
||||||
|
if (conf_dir == NULL)
|
||||||
|
return -1;
|
||||||
sprintf(conf_file, "%s/%d.conf", conf_dir, vpsid);
|
sprintf(conf_file, "%s/%d.conf", conf_dir, vpsid);
|
||||||
free(conf_dir);
|
free(conf_dir);
|
||||||
|
|
||||||
@ -678,6 +680,8 @@ openvzSetUUID(int vpsid)
|
|||||||
int fd, ret;
|
int fd, ret;
|
||||||
|
|
||||||
conf_dir = openvzLocateConfDir();
|
conf_dir = openvzLocateConfDir();
|
||||||
|
if (conf_dir == NULL)
|
||||||
|
return -1;
|
||||||
sprintf(conf_file, "%s/%d.conf", conf_dir, vpsid);
|
sprintf(conf_file, "%s/%d.conf", conf_dir, vpsid);
|
||||||
free(conf_dir);
|
free(conf_dir);
|
||||||
|
|
||||||
@ -719,6 +723,8 @@ int openvzAssignUUIDs(void)
|
|||||||
char ext[8];
|
char ext[8];
|
||||||
|
|
||||||
conf_dir = openvzLocateConfDir();
|
conf_dir = openvzLocateConfDir();
|
||||||
|
if (conf_dir == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
dp = opendir(conf_dir);
|
dp = opendir(conf_dir);
|
||||||
if(dp == NULL) {
|
if(dp == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user