free possible memory leak found by Coverity static analysis (Jiri Popelka)
authorBart De Schuymer <bdschuym@pandora.be>
Thu, 23 Jun 2011 18:26:45 +0000 (18:26 +0000)
committerBart De Schuymer <bdschuym@pandora.be>
Thu, 23 Jun 2011 18:26:45 +0000 (18:26 +0000)
extensions/ebt_among.c

index f90438e..b98f65b 100644 (file)
@@ -202,11 +202,13 @@ static struct ebt_mac_wormhash *create_wormhash(const char *arg)
                        if (read_until(&pc, ":", token, 2) < 0
                            || token[0] == 0) {
                                ebt_print_error("MAC parse error: %.20s", anchor);
+                               free(workcopy);
                                return NULL;
                        }
                        mac[i] = strtol(token, &endptr, 16);
                        if (*endptr) {
                                ebt_print_error("MAC parse error: %.20s", anchor);
+                               free(workcopy);
                                return NULL;
                        }
                        pc++;