cfgparser: fix a copy/paste error and resulting memory leak
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 12:06:55 +0000 (14:06 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 23 Oct 2012 12:15:24 +0000 (14:15 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/cfgparser/oparse.y

index f5d4e5b..c123ae4 100644 (file)
@@ -978,8 +978,9 @@ ifnick: TOK_STRING
     memset(in->cnf, 0x00, sizeof(*in->cnf));
 
     in->cnfi = malloc(sizeof(*in->cnfi));
-    if (in->cnf == NULL) {
+    if (in->cnfi == NULL) {
       fprintf(stderr, "Out of memory(ADD IFRULE)\n");
+      free (in->cnf);
       free(in);
       YYABORT;
     }