Fix buffer passed to free()

This commit is contained in:
Daniel P. Berrange committed 2008-01-08 16:17:15 +00:00
1 parent 94e49e3f0e
commit 8cd4774468
2 files changed
+5 -1

No files matched your search

+4
View File
@@ -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
+1 -1
View File
@@ -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));