From f3893a6b82bd8d8729f9f42b3e33348bd4260abf Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 8 May 2017 02:53:44 +0200 Subject: Fix potential memory leaks --- src/x11_in_gtk2.c | 1 + src/x11_in_gtk3.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/x11_in_gtk2.c b/src/x11_in_gtk2.c index 4b9e3cf..268e312 100644 --- a/src/x11_in_gtk2.c +++ b/src/x11_in_gtk2.c @@ -69,6 +69,7 @@ x_window_is_valid(SuilX11Wrapper* socket) &root, &parent, &children, &childcount); for (unsigned i = 0; i < childcount; ++i) { if (children[i] == (Window)socket->instance->ui_widget) { + XFree(children); return true; } } diff --git a/src/x11_in_gtk3.c b/src/x11_in_gtk3.c index 0ff0ead..6dd00f6 100644 --- a/src/x11_in_gtk3.c +++ b/src/x11_in_gtk3.c @@ -70,6 +70,7 @@ x_window_is_valid(SuilX11Wrapper* socket) &root, &parent, &children, &childcount); for (unsigned i = 0; i < childcount; ++i) { if (children[i] == (Window)socket->instance->ui_widget) { + XFree(children); return true; } } -- cgit v1.2.1