lclint annotations.
authorjbj <devnull@localhost>
Mon, 25 Oct 1999 19:07:14 +0000 (19:07 +0000)
committerjbj <devnull@localhost>
Mon, 25 Oct 1999 19:07:14 +0000 (19:07 +0000)
CVS patchset: 3400
CVS date: 1999/10/25 19:07:14

popt/popt.c
popt/poptint.h
popt/poptparse.c

index 4eeb8fe..11eb184 100644 (file)
@@ -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;
index 89ef4e9..1688095 100644 (file)
@@ -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;
index ad455de..65c948b 100644 (file)
@@ -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++) {