Changeset: 1833a77a18ed for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1833a77a18ed
Modified Files:
gdk/gdk_hash.c
Branch: Jun2023
Log Message:
Free heap on failure.
diffs (19 lines):
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -141,8 +141,14 @@ HASHnew(Hash *h, int tpe, BUN size, BUN
h->heaplink.dirty = true;
h->Link = h->heaplink.base;
}
- if (HEAPalloc(&h->heapbckt, mask + HASH_HEADER_SIZE * SIZEOF_SIZE_T /
h->width, h->width) != GDK_SUCCEED)
+ if (HEAPalloc(&h->heapbckt, mask + HASH_HEADER_SIZE * SIZEOF_SIZE_T /
h->width, h->width) != GDK_SUCCEED) {
+ if (!bcktonly) {
+ HEAPfree(&h->heaplink, true);
+ h->heaplink.free = 0;
+ h->Link = NULL;
+ }
return GDK_FAIL;
+ }
h->heapbckt.free = mask * h->width + HASH_HEADER_SIZE * SIZEOF_SIZE_T;
h->heapbckt.dirty = true;
h->nbucket = mask;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]