Changeset: 9c5b7d0a3f58 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9c5b7d0a3f58 Modified Files: monetdb5/mal/mal_exception.c monetdb5/mal/mal_instruction.c Branch: default Log Message:
fixed crash on malloc failure diffs (39 lines): diff --git a/monetdb5/mal/mal_exception.c b/monetdb5/mal/mal_exception.c --- a/monetdb5/mal/mal_exception.c +++ b/monetdb5/mal/mal_exception.c @@ -141,7 +141,9 @@ showException(stream *out, enum malexcep va_end(ap); dumpExceptionsToStream(out, msg); - GDKfree(msg); + if (msg && msg != M5OutOfMemory) { + GDKfree(msg); + } } /** diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c --- a/monetdb5/mal/mal_instruction.c +++ b/monetdb5/mal/mal_instruction.c @@ -410,8 +410,10 @@ newInstruction(MalBlkPtr mb, int kind) } if (p == NULL) { p = GDKzalloc(MAXARG * sizeof(p->argv[0]) + offsetof(InstrRecord, argv)); - if (p == NULL) + if (p == NULL) { + showException(GDKout, MAL, "pushEndInstruction", "memory allocation failure"); return NULL; + } p->maxarg = MAXARG; } p->typechk = TYPE_UNKNOWN; @@ -1540,6 +1542,9 @@ pushEndInstruction(MalBlkPtr mb) InstrPtr p; p = newInstruction(mb, ENDsymbol); + if (!p) { + return; + } p->argc = 0; p->retc = 0; p->argv[0] = 0; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list