OSSP CVS Repository

ossp - Difference in ossp-pkg/fsl/fsl.c versions 1.63 and 1.64
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/fsl/fsl.c 1.63 -> 1.64

--- fsl.c        2003/10/13 13:18:28     1.63
+++ fsl.c        2003/10/13 13:35:51     1.64
@@ -394,7 +394,6 @@
     fsl_rc_t rc;
     DIR *dp = NULL;
     struct dirent *de;
-    char *filename = NULL;
     char *cfgdir;
     char *prefix;
     char **filearr = NULL;
@@ -437,19 +436,18 @@
         }
     }
     qsort((void *)filearr, (size_t)filecnt, sizeof(char *), fnamecmp);
-    while (fileidx < filecnt) { /* loop once for every string in sorted array */
+    for (fileidx = 0; fileidx < filecnt; fileidx++)
         if (appendfiletobuffer(buffer, filearr[fileidx]) == FSL_OK)
             rc = FSL_OK;
-        free(filearr[fileidx]);
-        filearr[fileidx] = NULL;
-        fileidx++;
-    }
     CU(rc);
 CUS:
     if (dp != NULL)
         closedir(dp);
-    if (filename != NULL)
-        free(filename);
+    if (filearr != NULL) {
+        for (fileidx = 0; fileidx < filecnt; fileidx++)
+            free(filearr[fileidx]);
+        free(filearr);
+    }
     return rc;
 }
 

CVSTrac 2.0.1