From 1834607ce22aef2cae4ad75d44c5a984d6bc9661 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Thu, 7 Nov 2019 15:17:37 +0200 Subject: Fix ancient memleak on %patch -P from unused popt arg pointer -P can appear multiple times so a string arg pointer is not the right thing here in any case. There are other similar and related leaks all over the codebase but this is especially insulting as the leaked pointer was never used for anything at all. Thanks for Peter Jones for pointing this out. (cherry picked from commit 29d70efb1d9b2161f3fcdbdf71945d6c7308432d) (cherry picked from commit c0fbb408068b5e2757971f32338690365eb0933f) --- build/parsePrep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/parsePrep.c b/build/parsePrep.c index 23015db84..c73f09e15 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -433,7 +433,7 @@ exit: */ static rpmRC doPatchMacro(rpmSpec spec, const char *line) { - char *opt_b, *opt_P, *opt_d, *opt_o; + char *opt_b, *opt_d, *opt_o; char *buf = NULL; int opt_p, opt_R, opt_E, opt_F; int argc, c; @@ -442,7 +442,7 @@ static rpmRC doPatchMacro(rpmSpec spec, const char *line) rpmRC rc = RPMRC_FAIL; /* assume failure */ struct poptOption const patchOpts[] = { - { NULL, 'P', POPT_ARG_STRING, &opt_P, 'P', NULL, NULL }, + { NULL, 'P', POPT_ARG_STRING, NULL, 'P', NULL, NULL }, { NULL, 'p', POPT_ARG_INT, &opt_p, 'p', NULL, NULL }, { NULL, 'R', POPT_ARG_NONE, &opt_R, 'R', NULL, NULL }, { NULL, 'E', POPT_ARG_NONE, &opt_E, 'E', NULL, NULL }, -- cgit v1.2.1