forked from enlightenment/enlightenment
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
This commit is contained in:
parent
f15a4a6f22
commit
534ae45303
|
@ -426,7 +426,6 @@ check(void)
|
||||||
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f = NULL;
|
f = NULL;
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
if (sscanf(buf, "%s %s %i", dummy, dummy, &temp) == 3)
|
if (sscanf(buf, "%s %s %i", dummy, dummy, &temp) == 3)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
else
|
else
|
||||||
|
@ -444,7 +443,6 @@ check(void)
|
||||||
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f = NULL;
|
f = NULL;
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
if (sscanf(buf, "%i", &temp) == 1)
|
if (sscanf(buf, "%i", &temp) == 1)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
else
|
else
|
||||||
|
@ -463,7 +461,6 @@ check(void)
|
||||||
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f = NULL;
|
f = NULL;
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
/* actually read the temp */
|
/* actually read the temp */
|
||||||
if (sscanf(buf, "%i", &temp) == 1)
|
if (sscanf(buf, "%i", &temp) == 1)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
@ -483,7 +480,6 @@ check(void)
|
||||||
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f = NULL;
|
f = NULL;
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
/* actually read the temp */
|
/* actually read the temp */
|
||||||
if (sscanf(buf, "%i", &temp) == 1)
|
if (sscanf(buf, "%i", &temp) == 1)
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
@ -505,7 +501,6 @@ check(void)
|
||||||
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f = NULL;
|
f = NULL;
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
p = strchr(buf, ':');
|
p = strchr(buf, ':');
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
|
@ -531,7 +526,6 @@ check(void)
|
||||||
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
if (fgets(buf, sizeof(buf), f) == NULL) goto error;
|
||||||
fclose(f);
|
fclose(f);
|
||||||
f = NULL;
|
f = NULL;
|
||||||
buf[sizeof(buf) - 1] = 0;
|
|
||||||
temp = atoi(buf);
|
temp = atoi(buf);
|
||||||
temp /= 1000;
|
temp /= 1000;
|
||||||
ret = 1;
|
ret = 1;
|
||||||
|
@ -549,12 +543,9 @@ check(void)
|
||||||
return -999;
|
return -999;
|
||||||
error:
|
error:
|
||||||
if (f) fclose(f);
|
if (f) fclose(f);
|
||||||
f = NULL;
|
|
||||||
sensor_type = SENSOR_TYPE_NONE;
|
sensor_type = SENSOR_TYPE_NONE;
|
||||||
if (sensor_name) free(sensor_name);
|
E_FREE(sensor_name);
|
||||||
sensor_name = NULL;
|
E_FREE(sensor_path);
|
||||||
if (sensor_path) free(sensor_path);
|
|
||||||
sensor_path = NULL;
|
|
||||||
return -999;
|
return -999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue