The fd is not closed after patterns have successfully been read from
a file. Bug reported by Bertrand Jacquin. Should be backported to 1.4.
const char *args[2];
struct acl_pattern *pattern;
int opaque;
+ int ret = 0;
file = fopen(filename, "r");
if (!file)
pattern = NULL; /* get a new one */
}
}
- if (pattern)
- free_pattern(pattern);
- return 1;
+
+ ret = 1; /* success */
out_free_pattern:
free_pattern(pattern);
out_close:
fclose(file);
- return 0;
+ return ret;
}
/* Parse an ACL expression starting at <args>[0], and return it.