summaryrefslogtreecommitdiffstats
path: root/lib/popt
diff options
context:
space:
mode:
authorJose A. Rivera <jarrpa@redhat.com>2014-03-03 11:52:46 +0530
committerJeremy Allison <jra@samba.org>2014-03-13 21:45:12 +0100
commitf164e81e8b268ccab6c51c966b569dd06106caa2 (patch)
treef4f74b298a50522e69b84a14f6a48fd67a58343d /lib/popt
parent2dc799bccdca00f0f2da2727ee22d1c3f6f563ce (diff)
downloadsamba-f164e81e8b268ccab6c51c966b569dd06106caa2.tar.gz
samba-f164e81e8b268ccab6c51c966b569dd06106caa2.tar.xz
samba-f164e81e8b268ccab6c51c966b569dd06106caa2.zip
lib/popt: Patch memory leak in popthelp.c
Memory created as "t" was not being free'd. Change-Id: I5f6e20acc6c440a1cd9908aed7a90de2000f22f8 Coverity-Id: 240599 Coverity-Id: 240600 Signed-off-by: Jose A. Rivera <jarrpa@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
Diffstat (limited to 'lib/popt')
-rw-r--r--lib/popt/popthelp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/popt/popthelp.c b/lib/popt/popthelp.c
index 0ed355a18d..4e2a1a56ce 100644
--- a/lib/popt/popthelp.c
+++ b/lib/popt/popthelp.c
@@ -253,8 +253,8 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol,
}
*te++ = ' ';
strcpy(te, defs);
- defs = (char *)_free(defs);
}
+ defs = (char *)_free(defs);
defs = t;
}
}
@@ -326,7 +326,7 @@ static void singleOptionHelp(FILE * fp, int maxLeftCol,
left = (char *)_free(left);
if (defs) {
- help = defs; defs = NULL;
+ help = defs;
}
helpLength = strlen(help);