Changeset: ebea0d523b73 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ebea0d523b73 Added Files: ChangeLog.Jun2016 Modified Files: monetdb5/mal/mal_module.c monetdb5/mal/mal_parser.c monetdb5/modules/mal/pcre.c Branch: default Log Message:
Merge with Jun2016 branch. diffs (77 lines): diff --git a/ChangeLog.Jun2016 b/ChangeLog.Jun2016 new file mode 100644 --- /dev/null +++ b/ChangeLog.Jun2016 @@ -0,0 +1,6 @@ +# ChangeLog file for candidate +# This file is updated with Maddlog + +* Fri Jul 1 2016 Sjoerd Mullender <sjo...@acm.org> +- Lots of memory leaks have been plugged across the whole system. + diff --git a/monetdb5/mal/mal_module.c b/monetdb5/mal/mal_module.c --- a/monetdb5/mal/mal_module.c +++ b/monetdb5/mal/mal_module.c @@ -24,8 +24,7 @@ Module mal_scope; /* the root of the Module scopeJump[256][256]; /* to speedup access to correct scope */ static void newSubScope(Module scope){ - int len = (MAXSCOPE)*sizeof(Module); - scope->subscope = (Symbol *) GDKzalloc(len); + scope->subscope = (Symbol *) GDKzalloc(MAXSCOPE * sizeof(Symbol)); } void diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c --- a/monetdb5/mal/mal_parser.c +++ b/monetdb5/mal/mal_parser.c @@ -1149,6 +1149,11 @@ fcnHeader(Client cntxt, int kind) curInstr = getInstrPtr(curBlk, 0); if (currChar(cntxt) != '('){ + if (cntxt->backup) { + freeSymbol(cntxt->curprg); + cntxt->curprg = cntxt->backup; + cntxt->backup = 0; + } parseError(cntxt, "function header '(' expected\n"); skipToEnd(cntxt); return curBlk; @@ -1160,6 +1165,7 @@ fcnHeader(Client cntxt, int kind) if (isModuleDefined(cntxt->nspace, getModuleId(curInstr)) == FALSE) { if (cntxt->backup) { + freeSymbol(cntxt->curprg); cntxt->curprg = cntxt->backup; cntxt->backup = 0; } @@ -1181,6 +1187,7 @@ fcnHeader(Client cntxt, int kind) if (ch == ')') break; if (cntxt->backup) { + freeSymbol(cntxt->curprg); cntxt->curprg = cntxt->backup; cntxt->backup = 0; } @@ -1262,6 +1269,7 @@ fcnHeader(Client cntxt, int kind) if (currChar(cntxt) != ')') { freeInstruction(curInstr); if (cntxt->backup) { + freeSymbol(cntxt->curprg); cntxt->curprg = cntxt->backup; cntxt->backup = 0; } diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c --- a/monetdb5/modules/mal/pcre.c +++ b/monetdb5/modules/mal/pcre.c @@ -33,6 +33,10 @@ #include <pcre.h> +#if PCRE_MAJOR < 8 || (PCRE_MAJOR == 8 && PCRE_MINOR < 13) +#define pcre_free_study my_pcre_free +#endif + pcre_export str PCREquote(str *r, const str *v); pcre_export str PCREmatch(bit *ret, const str *val, const str *pat); pcre_export str PCREimatch(bit *ret, const str *val, const str *pat); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list