[PATCH 1/2] wmbattery: Free memory allocated by strdup.

Doug Torrance <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
This corrects a mistake in [1] noticed by Andrew Shadura [2].

[1] http://repo.or.cz/dockapps.git/commitdiff/29e5012
[2] https://github.com/d-torrance/wmbattery/commit/9f7be30#commitcomment-12965145
---
 wmbattery/acpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/wmbattery/acpi.c b/wmbattery/acpi.c
index dc2f3bc..1cf3a8e 100644
--- a/wmbattery/acpi.c
+++ b/wmbattery/acpi.c
@@ -226,6 +226,7 @@ int find_items(char *itemname, char infoarray[ACPI_MAXITEM][128],
 			acpi_labels[label_info]);
 		snprintf(statusarray[i], sizeof(statusarray[i]), SYSFS_PATH "/%s/%s", devices[i],
 			acpi_labels[label_status]);
+		free(devices[i]);
 	}
 
 	free(devices);
-- 
2.1.4


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.