Coverity:
CID 739682 (#1 of 2): Resource leak (RESOURCE_LEAK)
At (84): Variable "in" going out of scope leaks the storage it points to.
CID 739682 (#2 of 2): Resource leak (RESOURCE_LEAK)
At (89): Variable "in" going out of scope leaks the storage it points to.
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
if (in->cnf == NULL || in->cnfi == NULL) {
fprintf(stderr, "Out of memory(ADD DEFIFRULE)\n");
+ if (in->cnf) {
+ free(in->cnf);
+ }
+ if (in->cnfi) {
+ free(in->cnfi);
+ }
+ free(in);
YYABORT;
}
in->cnf = malloc(sizeof(*in->cnf));
if (in->cnf == NULL) {
fprintf(stderr, "Out of memory(ADD IFRULE)\n");
+ free(in);
YYABORT;
}
memset(in->cnf, 0x00, sizeof(*in->cnf));
in->cnfi = malloc(sizeof(*in->cnfi));
if (in->cnf == NULL) {
fprintf(stderr, "Out of memory(ADD IFRULE)\n");
+ free(in);
YYABORT;
}
memset(in->cnfi, 0xFF, sizeof(*in->cnfi));