]> git.deb.at Git - pkg/abook.git/commitdiff
Fix bogus free()s on error path
authorPeter Wu <peter@lekensteyn.nl>
Mon, 16 Feb 2015 18:41:57 +0000 (19:41 +0100)
committerRaphaël Droz <raphael.droz+floss@gmail.com>
Sun, 22 Feb 2015 00:20:43 +0000 (21:20 -0300)
ft contains integers and ft itself was just malloced. Do not corrupt the
heap...

filter.c

index eb6e778042f9c63cef421e0306497868e0ef0b80..2ea5a2dd77bfa3acafa196f5f324a7b47cee2ed6 100644 (file)
--- 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);
 }