summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjbj <jbj>2016-12-23 17:00:01 +0000
committerjbj <jbj>2016-12-23 17:00:01 +0000
commit88219530934777064bc7d43e8c635a9e1aadacec (patch)
treea42ef20b14e7d1b7b928dc8458f85912ae497916
parent3d6654a054a75daab61b0d3909505404ef00d2a8 (diff)
downloadlibpopt-88219530934777064bc7d43e8c635a9e1aadacec.tar.gz
- sanity.
-rw-r--r--popt.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/popt.c b/popt.c
index 352d685..ea5b8c4 100644
--- a/popt.c
+++ b/popt.c
@@ -1308,16 +1308,25 @@ static int poptSaveArg(poptContext con, const struct poptOption * opt)
switch (poptArgType(opt)) {
case POPT_ARG_BITSET:
+ /* XXX memory leak, application is responsible for free. */
rc = poptSaveBits(arg.ptr, opt->argInfo, con->os->nextArg);
+#if 0
con->os->nextArg = _free(con->os->nextArg);
+#endif
/*@switchbreak@*/ break;
case POPT_ARG_ARGV:
+ /* XXX memory leak, application is responsible for free. */
rc = poptSaveString(arg.ptr, opt->argInfo, con->os->nextArg);
+#if 0
con->os->nextArg = _free(con->os->nextArg);
+#endif
/*@switchbreak@*/ break;
case POPT_ARG_STRING:
+ /* XXX memory leak, application is responsible for free. */
arg.argv[0] = con->os->nextArg;
+#if 1
con->os->nextArg = NULL;
+#endif
/*@switchbreak@*/ break;
case POPT_ARG_LONGLONG:
@@ -1387,7 +1396,9 @@ con->os->nextArg = NULL;
arg.shortp[0] = (short) aNUM;
/*@innerbreak@*/ break;
}
+#if 0
con->os->nextArg = _free(con->os->nextArg);
+#endif
} /*@switchbreak@*/ break;
case POPT_ARG_FLOAT:
@@ -1429,7 +1440,9 @@ con->os->nextArg = _free(con->os->nextArg);
arg.floatp[0] = (float) aDouble;
/*@innerbreak@*/ break;
}
+#if 0
con->os->nextArg = _free(con->os->nextArg);
+#endif
} /*@switchbreak@*/ break;
case POPT_ARG_MAINCALL:
/*@-assignexpose -type@*/