Fix theoretical memory leaks in edit_parse_actions_file()
authorFabian Keil <fk@fabiankeil.de>
Sat, 18 Oct 2014 11:25:42 +0000 (11:25 +0000)
committerFabian Keil <fk@fabiankeil.de>
Sat, 18 Oct 2014 11:25:42 +0000 (11:25 +0000)
CID 66388.

cgiedit.c

index d12554a..1443f6c 100644 (file)
--- a/cgiedit.c
+++ b/cgiedit.c
@@ -1,4 +1,4 @@
-const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.81 2014/06/02 06:22:20 fabiankeil Exp $";
+const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.82 2014/06/03 10:31:27 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/cgiedit.c,v $
@@ -1211,6 +1211,7 @@ jb_err edit_parse_actions_file(struct editable_file * file)
             err = split_line_on_equals(cur_line->unprocessed, &name, &value);
             if (err == JB_ERR_MEMORY)
             {
+               free_alias_list(alias_list);
                return err;
             }
             else if (err != JB_ERR_OK)
@@ -1218,6 +1219,7 @@ jb_err edit_parse_actions_file(struct editable_file * file)
                /* Line does not contain a name=value pair */
                file->parse_error = cur_line;
                file->parse_error_text = "Expected a name=value pair on this {{alias}} line, but couldn't find one.";
+               free_alias_list(alias_list);
                return JB_ERR_PARSE;
             }