diff --git a/client.c b/client.c index 6bd1f251e..2d1991c92 100644 --- a/client.c +++ b/client.c @@ -1302,11 +1302,13 @@ luaA_client_index(lua_State *L) if(!xutil_class_hint_get(globalconf.connection, (*c)->win, &hint)) return 0; lua_pushstring(L, hint.res_class); + xutil_class_hint_wipe(&hint); break; case A_TK_INSTANCE: if(!xutil_class_hint_get(globalconf.connection, (*c)->win, &hint)) return 0; lua_pushstring(L, hint.res_name); + xutil_class_hint_wipe(&hint); break; case A_TK_ROLE: if(!xutil_text_prop_get(globalconf.connection, (*c)->win, diff --git a/common/xutil.h b/common/xutil.h index 2766148fb..43021adc7 100644 --- a/common/xutil.h +++ b/common/xutil.h @@ -100,6 +100,13 @@ typedef struct char *res_class; } xutil_class_hint_t; +static inline void +xutil_class_hint_wipe(xutil_class_hint_t *c) +{ + p_delete(&c->res_name); + p_delete(&c->res_class); +} + bool xutil_class_hint_get(xcb_connection_t *, xcb_window_t, xutil_class_hint_t *); bool xutil_text_prop_get(xcb_connection_t *, xcb_window_t, xcb_atom_t, char **, ssize_t *);