From: Jelle van der Waa Date: Thu, 21 Sep 2017 19:41:11 +0000 (+0200) Subject: pgpewrap: free opts on exit X-Git-Tag: neomutt-20171006~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=78b760952f8629becbe557a41fc759a7a325467a;p=neomutt pgpewrap: free opts on exit opts is allocated with malloc, but never free'd in both exit scenario's leading to a memory leak of opts. --- diff --git a/pgpewrap.c b/pgpewrap.c index 2c158cb45..da7d30cce 100644 --- a/pgpewrap.c +++ b/pgpewrap.c @@ -47,6 +47,7 @@ int main(int argc, char **argv) i += 2; if (i > argc) { + free(opts); print_usage(argv[0]); } pfx = argv[i - 1]; @@ -59,5 +60,6 @@ int main(int argc, char **argv) execvp(opts[0], opts); perror(argv[0]); + free(opts); return 2; }