Fix ecore_file_ls usage.
authorsebastid <sebastid>
Thu, 6 Oct 2005 19:38:46 +0000 (19:38 +0000)
committersebastid <sebastid@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 6 Oct 2005 19:38:46 +0000 (19:38 +0000)
SVN revision: 17248

src/bin/e_apps.c
src/modules/temperature/e_mod_main.c

index 7976880..3a9baee 100644 (file)
@@ -1006,9 +1006,7 @@ e_app_dir_file_list_get(E_App *a)
        while ((file = ecore_list_next(files)))
          {
             if (file[0] != '.')
-              ecore_list_append(files2, file);
-            else
-              free(file);
+              ecore_list_append(files2, strdup(file));
          }
        ecore_list_destroy(files);
      }
index 14bf27e..c20f330 100644 (file)
@@ -987,7 +987,7 @@ _temperature_cb_check(void *data)
      }
 #else  
    therms = ecore_file_ls("/proc/acpi/thermal_zone");
-   if (!therms || ecore_list_is_empty(therms))
+   if ((!therms) || ecore_list_is_empty(therms))
      {
        FILE *f;
 
@@ -1001,6 +1001,7 @@ _temperature_cb_check(void *data)
          }
        else
          {
+            if (therms) ecore_list_destroy(therms);
             therms = ecore_file_ls("/sys/bus/i2c/devices");
             if ((therms) && (!ecore_list_is_empty(therms)))
               {
@@ -1034,6 +1035,7 @@ _temperature_cb_check(void *data)
                              }
                         }
                    }
+                 ecore_list_destroy(therms);
               }
          }
      }
@@ -1056,10 +1058,9 @@ _temperature_cb_check(void *data)
                    ret = 1;
                  fclose(f);
               }
-            free(name);
          }
+       ecore_list_destroy(therms);
      }
-   if (therms) ecore_list_destroy(therms);
 #endif   
    
    if (ef->conf->units == FAHRENHEIT)