summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2019-11-07 15:17:37 +0200
committerPanu Matilainen <pmatilai@redhat.com>2019-11-18 12:46:29 +0200
commitc0fbb408068b5e2757971f32338690365eb0933f (patch)
tree794413149994f2f436457a637f28a49d18d65dde
parent80ba9c57fd9a255bd1a27adf20db2bf72c6ec06a (diff)
downloadrpm-c0fbb408068b5e2757971f32338690365eb0933f.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. (cherry picked from commit 29d70efb1d9b2161f3fcdbdf71945d6c7308432d)
-rw-r--r--build/parsePrep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c
index e2ba98ea1..8dee3134f 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -394,7 +394,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;
@@ -403,7 +403,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 },