From 78b760952f8629becbe557a41fc759a7a325467a Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Thu, 21 Sep 2017 21:41:11 +0200 Subject: [PATCH] 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. --- pgpewrap.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.40.0