From: jbj Date: Mon, 25 Oct 1999 19:07:14 +0000 (+0000) Subject: lclint annotations. X-Git-Tag: rpm-4.4-release~2524 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b074f1e2e712870d73613b4f8d848e963182b7e5;p=platform%2Fupstream%2Frpm.git lclint annotations. CVS patchset: 3400 CVS date: 1999/10/25 19:07:14 --- diff --git a/popt/popt.c b/popt/popt.c index 4eeb8fe..11eb184 100644 --- a/popt/popt.c +++ b/popt/popt.c @@ -111,8 +111,12 @@ void poptResetContext(poptContext con) { con->restLeftover = 0; con->doExec = NULL; - for (i = 0; i < con->finalArgvCount; i++) - xfree(con->finalArgv[i]); + for (i = 0; i < con->finalArgvCount; i++) { + if (con->finalArgv[i]) { + xfree(con->finalArgv[i]); + con->finalArgv[i] = NULL; + } + } con->finalArgvCount = 0; } @@ -329,7 +333,7 @@ static const char *findNextArg(poptContext con, unsigned argx, int delete) return arg; } -static const char * expandNextArg(poptContext con, const char * s) +static /*@only@*/ const char * expandNextArg(poptContext con, const char * s) { const char *a; size_t alen; diff --git a/popt/poptint.h b/popt/poptint.h index 89ef4e9..1688095 100644 --- a/popt/poptint.h +++ b/popt/poptint.h @@ -23,10 +23,10 @@ typedef struct { struct optionStackEntry { int argc; - /*@keep@*/ const char ** argv; + /*@only@*/ const char ** argv; /*@only@*/ pbm_set * argb; int next; - /*@keep@*/ const char * nextArg; + /*@only@*/ const char * nextArg; /*@keep@*/ const char * nextCharArg; /*@dependent@*/ struct poptAlias * currAlias; int stuffed; diff --git a/popt/poptparse.c b/popt/poptparse.c index ad455de..65c948b 100644 --- a/popt/poptparse.c +++ b/popt/poptparse.c @@ -21,7 +21,8 @@ int poptDupArgv(int argc, const char **argv, nb += strlen(argv[i]) + 1; } - argv2 = (void *) dst = malloc(nb); + dst = malloc(nb); + argv2 = (void *) dst; dst += (argc + 1) * sizeof(*argv); for (i = 0; i < argc; i++) {