aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/temperature/tempget.c
diff options
context:
space:
mode:
authorMaxime Villard <rustyBSD@gmx.fr>2012-12-15 14:29:38 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-12-15 14:29:38 +0000
commit534ae453038e2ee343c3ec924f1c6093f2ea7bf6 (patch)
tree9db22d6244bcc79fe2c83d4b653c2cfff5090612 /src/modules/temperature/tempget.c
parentadn as discussed - fill out default theme to cover some of the other (diff)
downloadenlightenment-534ae453038e2ee343c3ec924f1c6093f2ea7bf6.tar.gz
From: Maxime Villard <rustyBSD@gmx.fr>
Subject: Re: [E-devel] [e] [patch] Leak (was FreeBSD patch) I would also move some {free(x); x = null} to E_FREE. SVN revision: 81023
Diffstat (limited to 'src/modules/temperature/tempget.c')
-rw-r--r--src/modules/temperature/tempget.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/modules/temperature/tempget.c b/src/modules/temperature/tempget.c
index 7bad3d97f..6d614a178 100644
--- a/src/modules/temperature/tempget.c
+++ b/src/modules/temperature/tempget.c
@@ -426,7 +426,6 @@ check(void)
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
if (sscanf(buf, "%s %s %i", dummy, dummy, &temp) == 3)
ret = 1;
else
@@ -444,7 +443,6 @@ check(void)
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
if (sscanf(buf, "%i", &temp) == 1)
ret = 1;
else
@@ -463,7 +461,6 @@ check(void)
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
/* actually read the temp */
if (sscanf(buf, "%i", &temp) == 1)
ret = 1;
@@ -483,7 +480,6 @@ check(void)
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
/* actually read the temp */
if (sscanf(buf, "%i", &temp) == 1)
ret = 1;
@@ -505,7 +501,6 @@ check(void)
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
p = strchr(buf, ':');
if (p)
{
@@ -531,7 +526,6 @@ check(void)
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
fclose(f);
f = NULL;
- buf[sizeof(buf) - 1] = 0;
temp = atoi(buf);
temp /= 1000;
ret = 1;
@@ -549,12 +543,9 @@ check(void)
return -999;
error:
if (f) fclose(f);
- f = NULL;
sensor_type = SENSOR_TYPE_NONE;
- if (sensor_name) free(sensor_name);
- sensor_name = NULL;
- if (sensor_path) free(sensor_path);
- sensor_path = NULL;
+ E_FREE(sensor_name);
+ E_FREE(sensor_path);
return -999;
}