Changeset: 0a74545351a0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0a74545351a0 Modified Files: monetdb5/modules/mal/bbp.c Branch: Jan2014 Log Message:
Close resource leak. diffs (20 lines): diff --git a/monetdb5/modules/mal/bbp.c b/monetdb5/modules/mal/bbp.c --- a/monetdb5/modules/mal/bbp.c +++ b/monetdb5/modules/mal/bbp.c @@ -374,11 +374,12 @@ CMDdecompressheap(Heap *h, Heap *hn, str GDKfilepath(buf, BATDIR, buf2, "gz"); fp = open_gzrstream(buf); if ( fp && !mnstr_errnr(fp)){ - if ( HEAPextend(hn,h->size,0) < 0) + if ( HEAPextend(hn,h->size,0) < 0 || + /* skip header */ + (ssize_t) h->size != mnstr_read(fp, (void*) hn->base,1, h->size)) { + close_stream(fp); return -999; - /* skip header */ - if ((ssize_t) h->size != mnstr_read(fp, (void*) hn->base,1, h->size)) - return -999; + } hn->free = h->free; if (h->parentid) BBPkeepref( h->parentid); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list