Changeset: 35bf81017569 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=35bf81017569
Modified Files:
gdk/gdk_storage.c
Branch: Jul2017
Log Message:
Fix leak: if loading fails, free the heap since no reference is returned.
diffs (19 lines):
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -798,6 +798,7 @@ BATload_intern(bat bid, int lock)
/* LOAD bun heap */
if (b->ttype != TYPE_void) {
if (HEAPload(&b->theap, nme, "tail", b->batRestricted ==
BAT_READ) != GDK_SUCCEED) {
+ HEAPfree(&b->theap, 0);
return NULL;
}
assert(b->theap.size >> b->tshift <= BUN_MAX);
@@ -810,6 +811,7 @@ BATload_intern(bat bid, int lock)
if (ATOMvarsized(b->ttype)) {
if (HEAPload(b->tvheap, nme, "theap", b->batRestricted ==
BAT_READ) != GDK_SUCCEED) {
HEAPfree(&b->theap, 0);
+ HEAPfree(b->tvheap, 0);
return NULL;
}
if (ATOMstorage(b->ttype) == TYPE_str) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list