From: Peter Wu Date: Mon, 16 Feb 2015 18:41:57 +0000 (+0100) Subject: Fix bogus free()s on error path X-Git-Tag: upstream/0.6.1~2^2~3 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=b83bcbf03847d0e450aff06f3fcc948469c93773;p=pkg%2Fabook.git Fix bogus free()s on error path ft contains integers and ft itself was just malloced. Do not corrupt the heap... --- diff --git a/filter.c b/filter.c index eb6e778..2ea5a2d 100644 --- a/filter.c +++ b/filter.c @@ -2647,7 +2647,7 @@ parse_custom_format(char *s, char *fmt_string, enum field_types *ft) cannotparse: fprintf(stderr, _("%s: invalid format, index %ld\n"), __FUNCTION__, (start - s)); free(fmt_string); - while(*ft) free(ft--); + free(ft); exit(EXIT_FAILURE); }