From 88219530934777064bc7d43e8c635a9e1aadacec Mon Sep 17 00:00:00 2001 From: jbj Date: Fri, 23 Dec 2016 17:00:01 +0000 Subject: - sanity. --- popt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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@*/ -- cgit v1.2.1