[hackers] [dwm][PATCH] remember to free everything we create

From: Devin J. Pohly <djpohly_AT_gmail.com>
Date: Sun, 26 Jan 2020 18:16:48 -0600

Leaks found with Valgrind. Alternatively, drw_fontset_free could be
called from drw_free if drw->fonts != NULL.
---
 dwm.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/dwm.c b/dwm.c
index 4465af1..03f9546 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -486,7 +486,9 @@ cleanup(void)
 		drw_cur_free(drw, cursor[i]);
 	for (i = 0; i < LENGTH(colors); i++)
 		free(scheme[i]);
+	free(scheme);
 	XDestroyWindow(dpy, wmcheckwin);
+	drw_fontset_free(drw->fonts);
 	drw_free(drw);
 	XSync(dpy, False);
 	XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
-- 
2.25.0
Received on Mon Jan 27 2020 - 01:16:48 CET

This archive was generated by hypermail 2.3.0 : Mon Jan 27 2020 - 01:36:26 CET