diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-07-24 01:07:06 -0300 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2009-07-24 01:07:06 -0300 |
commit | a4ac65d02a2ba5eb210fc3285f8e9d92e5132dc8 (patch) | |
tree | 12b7157ff6cb49bf2b0cbabb64a0a8e4f2514ad8 /hardinfo2/arch/linux/common/sensors.h | |
parent | 7d522a068ba6427948ffe00d3674dc34463607a7 (diff) |
Cleaner fix for file descriptor leak.
(Ref. commit 8a77a967204d04cdf202622f22a49b76e860b1e5)
Diffstat (limited to 'hardinfo2/arch/linux/common/sensors.h')
-rw-r--r-- | hardinfo2/arch/linux/common/sensors.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hardinfo2/arch/linux/common/sensors.h b/hardinfo2/arch/linux/common/sensors.h index ae68c22a..abbe90b4 100644 --- a/hardinfo2/arch/linux/common/sensors.h +++ b/hardinfo2/arch/linux/common/sensors.h @@ -319,6 +319,7 @@ static void read_sensors_hddtemp(void) if ((s = sock_connect("127.0.0.1", 7634))) { while (!len) len = sock_read(s, buffer, sizeof(buffer)); + sock_close(s); if (len > 2 && buffer[0] == '|' && buffer[1] == '/') { gchar **disks; @@ -353,7 +354,6 @@ static void read_sensors_hddtemp(void) g_free(old); old = NULL; } - sock_close(s); if (old) { sensors = g_strconcat(sensors, "\n", old, NULL); |