mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
Fix buffer passed to free()
This commit is contained in:
parent
94e49e3f0e
commit
8cd4774468
@ -1,3 +1,7 @@
|
|||||||
|
Tue Jan 8 11:12:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
|
* src/util.c: Fix addr passed to free() in error cleanup
|
||||||
|
|
||||||
Mon Jan 7 10:19:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
Mon Jan 7 10:19:00 EST 2008 Daniel P. Berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* src/util.c, src/util.h: virFileReadAll() now allocates its
|
* src/util.c, src/util.h: virFileReadAll() now allocates its
|
||||||
|
@ -308,7 +308,7 @@ int virFileReadAll(const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ret = fread(*buf, st.st_size, 1, fh)) != 1) {
|
if ((ret = fread(*buf, st.st_size, 1, fh)) != 1) {
|
||||||
free(buf);
|
free(*buf);
|
||||||
*buf = NULL;
|
*buf = NULL;
|
||||||
virLog("Failed to read config file '%s': %s",
|
virLog("Failed to read config file '%s': %s",
|
||||||
path, strerror(errno));
|
path, strerror(errno));
|
||||||
|
Loading…
Reference in New Issue
Block a user