From 8a77a967204d04cdf202622f22a49b76e860b1e5 Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Fri, 24 Jul 2009 00:53:08 -0300 Subject: Plug file descriptor leak (as per Debian bug #523930). Thanks to giagimari at libero dot it for strace logs. --- hardinfo2/arch/linux/common/sensors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hardinfo2') diff --git a/hardinfo2/arch/linux/common/sensors.h b/hardinfo2/arch/linux/common/sensors.h index 2a656bc3..ae68c22a 100644 --- a/hardinfo2/arch/linux/common/sensors.h +++ b/hardinfo2/arch/linux/common/sensors.h @@ -319,7 +319,6 @@ 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; @@ -354,6 +353,7 @@ static void read_sensors_hddtemp(void) g_free(old); old = NULL; } + sock_close(s); if (old) { sensors = g_strconcat(sensors, "\n", old, NULL); -- cgit v1.2.3