X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/dd35c00e9a5be37b91f9a2f509cf2cacbb3b5323..211567363bd8bfbd70cef81e4208ea02d49ebb55:/newsearch/ns-match.c diff --git a/newsearch/ns-match.c b/newsearch/ns-match.c index a4dba15d..d77680c8 100644 --- a/newsearch/ns-match.c +++ b/newsearch/ns-match.c @@ -39,6 +39,8 @@ struct searchNode *match_parse(searchCtx *ctx, int argc, char **argv) { if (!(localdata=(struct match_localdata *)malloc(sizeof (struct match_localdata)))) { parseError = "malloc: could not allocate memory for this search."; + (targnode->free)(ctx, targnode); + (patnode->free)(ctx, patnode); return NULL; } @@ -48,6 +50,8 @@ struct searchNode *match_parse(searchCtx *ctx, int argc, char **argv) { if (!(thenode=(struct searchNode *)malloc(sizeof(struct searchNode)))) { /* couldn't malloc() memory for thenode, so free localdata to avoid leakage */ parseError = "malloc: could not allocate memory for this search."; + (targnode->free)(ctx, targnode); + (patnode->free)(ctx, patnode); free(localdata); return NULL; }