From e620cb652c65a13c8f22b173e53aaf56018874af Mon Sep 17 00:00:00 2001 From: "Mark M. Hoffman" Date: Mon, 15 May 2006 03:06:05 +0000 Subject: [PATCH] fix 2 leaks found by valgrind - missing some free() during cleanup (as opposed to ongoing run-time leaks) git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3293 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/init.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/init.c b/lib/init.c index 156d83f8..a503a4a0 100644 --- a/lib/init.c +++ b/lib/init.c @@ -106,6 +106,11 @@ void free_chip(sensors_chip chip) { int i; + for (i = 0; i < chip.chips.fits_count; i++) + free_chip_name(chip.chips.fits[i]); + free(chip.chips.fits); + chip.chips.fits_count = chip.chips.fits_max = 0; + for (i = 0; i < chip.labels_count; i++) free_label(chip.labels[i]); free(chip.labels);