diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2019-11-07 15:17:37 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2019-11-08 10:50:02 +0200 |
commit | 29d70efb1d9b2161f3fcdbdf71945d6c7308432d (patch) | |
tree | 2b68a6d25a9a0cfce7a50526626201f0f8824b4d /build/parsePrep.c | |
parent | 97a873aff54ebc9801d0d6663da6a084055443e4 (diff) | |
download | rpm-29d70efb1d9b2161f3fcdbdf71945d6c7308432d.tar.gz |
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.
Diffstat (limited to 'build/parsePrep.c')
-rw-r--r-- | build/parsePrep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c index 0751cf494..64b062109 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -389,7 +389,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, opt_Z; int argc, c; @@ -398,7 +398,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 }, |