commit f99460db09e1eca862b43edf41905d33546ccf79
parent 1c2f9b46506ce4a7dd2f32856b09f89dbe46ad93
Author: sin <sin@2f30.org>
Date: Sun, 15 May 2016 13:34:06 +0100
Fix memory leak
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/spoon.c b/spoon.c
@@ -100,7 +100,7 @@ xkblayoutread(char *buf, size_t len)
Display *dpy;
XkbStateRec state;
XkbRF_VarDefsRec vd;
- char *tmp, *str, *tok;
+ char *tmp = NULL, *str, *tok;
int i, ret = 0;
dpy = XOpenDisplay(NULL);
@@ -131,6 +131,7 @@ xkblayoutread(char *buf, size_t len)
out2:
free(str);
out1:
+ free(tmp);
XFree(vd.options);
out0:
XCloseDisplay(dpy);