]> jfr.im git - irc/quakenet/newserv.git/blobdiff - newsearch/ns-match.c
CHANSERV: fix issue where chanserv_relay doesn't wait for db to be loaded before...
[irc/quakenet/newserv.git] / newsearch / ns-match.c
index a4dba15d19a11e991ce2b2de4f610e6e99c9347f..d77680c81dd9df7bc22a787d93ff16015bf3f6c2 100644 (file)
@@ -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;
   }