Changeset: 5a46b4243272 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a46b4243272
Modified Files:
        gdk/gdk_bat.c
Branch: Jul2012
Log Message:

HEAPload can fail: deal with it.
Found by Coverity.


diffs (16 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -362,7 +362,11 @@ BATattach(int tt, const char *heapfile)
        bn->batRestricted = BAT_READ;
        bn->T->heap.size = (size_t) st.st_size;
        bn->T->heap.newstorage = bn->T->heap.storage = (bn->T->heap.size < 
REMAP_PAGE_MAXSIZE) ? STORE_MEM : STORE_MMAP;
-       HEAPload(&bn->T->heap, BBP_physical(bn->batCacheid), "tail", TRUE);
+       if (HEAPload(&bn->T->heap, BBP_physical(bn->batCacheid), "tail", TRUE) 
< 0) {
+               HEAPfree(&bn->T->heap);
+               GDKfree(bs);
+               return NULL;
+       }
        BBPcacheit(bs, 1);
        return bn;
 }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to