[Kst] extragear/graphics/kst/kst/datasources/dirfile

George Staikos staikos at kde.org
Thu Nov 24 03:40:59 CET 2005


SVN commit 482757 by staikos:

Don's patch to fix descriptor leak fix
CCBUG: 116981


 M  +7 -0      getdata.c  


--- trunk/extragear/graphics/kst/kst/datasources/dirfile/getdata.c #482756:482757
@@ -345,12 +345,14 @@
       *error_code = GD_E_FORMAT;
       FreeF(F);
       Formats.n--;
+      fclose(fp);
       return(NULL);
     }
     if (strlen(in_cols[0])>FIELD_LENGTH) {
       *error_code = GD_E_FIELD;
       FreeF(F);
       Formats.n--;
+      fclose(fp);
       return(NULL);
     }
     if (strcmp(in_cols[1], "RAW")==0) {
@@ -398,14 +400,19 @@
       FreeF(F);
       Formats.n--;
       *error_code = GD_E_FORMAT;
+      fclose(fp);
       return(NULL);
     }
     if (*error_code!=GD_E_OK) {
       FreeF(F);
       Formats.n--;
+      fclose(fp);
       return(NULL);
     }
   }
+
+  fclose(fp);
+  
   /** Now sort the lists */
   if (F->n_raw > 1) {
     for (i=0; i<F->n_raw; i++) {


More information about the Kst mailing list