mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fix buffer passed to free()
This commit is contained in:
@@ -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>
|
||||
|
||||
* 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) {
|
||||
free(buf);
|
||||
free(*buf);
|
||||
*buf = NULL;
|
||||
virLog("Failed to read config file '%s': %s",
|
||||
path, strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user