summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2019-11-07 15:17:37 +0200
committerPanu Matilainen <pmatilai@redhat.com>2020-03-26 11:57:58 +0200
commit1834607ce22aef2cae4ad75d44c5a984d6bc9661 (patch)
tree85d3e5f26a02ab01ade03b58b023107c773283d7
parentbcf4823505adc4c33d8bf722ceafaaaac1727637 (diff)
downloadrpm-1834607ce22aef2cae4ad75d44c5a984d6bc9661.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) (cherry picked from commit c0fbb408068b5e2757971f32338690365eb0933f)
-rw-r--r--build/parsePrep.c4
1 files 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 },