[server] minor memory leak bug fix during access.conf parsing found by Coverity
authorMichael Rash <mbr@cipherdyne.org>
Tue, 14 May 2013 00:48:23 +0000 (20:48 -0400)
committerMichael Rash <mbr@cipherdyne.org>
Tue, 14 May 2013 00:48:23 +0000 (20:48 -0400)
server/access.c

index 88ca7fd..88039c9 100644 (file)
@@ -1365,13 +1365,15 @@ acc_check_port_access(acc_stanza_t *acc, char *port_str)
                     "Unable to create acc_port_list from incoming data: %s",
                     port_str
                 );
+                free_acc_port_list(in_pl);
                 return(0);
             }
             strlcpy(buf, start, (ndx-start)+1);
             if(add_port_list_ent(&in_pl, buf) == 0)
             {
                 log_msg(LOG_ERR, "Invalid proto/port string");
-                return 0;
+                free_acc_port_list(in_pl);
+                return(0);
             }
 
             start = ndx+1;
@@ -1386,6 +1388,7 @@ acc_check_port_access(acc_stanza_t *acc, char *port_str)
             "Unable to create acc_port_list from incoming data: %s",
             port_str
         );
+        free_acc_port_list(in_pl);
         return(0);
     }
     strlcpy(buf, start, (ndx-start)+1);