ret &= ip6tc_delete_entry(chain, fw, mask, handle);
}
}
+ free(mask);
+
return ret;
}
for (matchp = *matches; matchp;) {
tmp = matchp->next;
+ if (matchp->match->m)
+ free(matchp->match->m);
free(matchp);
matchp = tmp;
}
memset(&fw, 0, sizeof(fw));
- opts = original_opts;
- global_option_offset = 0;
-
/* re-set optind to 0 in case do_command gets called
* a second time */
optind = 0;
printf("Warning: using chain %s, not extension\n",
jumpto);
+ if (target->t)
+ free(target->t);
+
target = NULL;
}
find_target(jumpto, LOAD_MUST_SUCCEED);
} else {
e = generate_entry(&fw, matches, target->t);
+ free(target->t);
}
}
clear_rule_matches(&matches);
+ if (e != NULL) {
+ free(e);
+ e = NULL;
+ }
+
+ for (c = 0; c < nsaddrs; c++)
+ free(&saddrs[c]);
+
+ for (c = 0; c < ndaddrs; c++)
+ free(&daddrs[c]);
+
+ if (opts != original_opts) {
+ free(opts);
+ opts = original_opts;
+ global_option_offset = 0;
+ }
+
return ret;
}
ret &= iptc_delete_entry(chain, fw, mask, handle);
}
}
+ free(mask);
+
return ret;
}
for (matchp = *matches; matchp;) {
tmp = matchp->next;
+ if (matchp->match->m)
+ free(matchp->match->m);
free(matchp);
matchp = tmp;
}
memset(&fw, 0, sizeof(fw));
- opts = original_opts;
- global_option_offset = 0;
-
/* re-set optind to 0 in case do_command gets called
* a second time */
optind = 0;
printf("Warning: using chain %s, not extension\n",
jumpto);
+ if (target->t)
+ free(target->t);
+
target = NULL;
}
find_target(jumpto, LOAD_MUST_SUCCEED);
} else {
e = generate_entry(&fw, matches, target->t);
+ free(target->t);
}
}
clear_rule_matches(&matches);
+ if (e != NULL) {
+ free(e);
+ e = NULL;
+ }
+
+ for (c = 0; c < nsaddrs; c++)
+ free(&saddrs[c]);
+
+ for (c = 0; c < ndaddrs; c++)
+ free(&daddrs[c]);
+
+ if (opts != original_opts) {
+ free(opts);
+ opts = original_opts;
+ global_option_offset = 0;
+ }
+
return ret;
}