From d4a41079f7432a4386ad428530b487927420f636 Mon Sep 17 00:00:00 2001 From: sebastid Date: Thu, 6 Oct 2005 19:38:46 +0000 Subject: [PATCH] Fix ecore_file_ls usage. SVN revision: 17248 --- src/bin/e_apps.c | 4 +--- src/modules/temperature/e_mod_main.c | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bin/e_apps.c b/src/bin/e_apps.c index 7976880cb..3a9baee03 100644 --- a/src/bin/e_apps.c +++ b/src/bin/e_apps.c @@ -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); } diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index 14bf27ebe..c20f33048 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -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)