summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-05-08 02:53:44 +0200
committerDavid Robillard <d@drobilla.net>2017-05-08 02:53:44 +0200
commitf3893a6b82bd8d8729f9f42b3e33348bd4260abf (patch)
tree5cee43adcea9fe8a8dec1e56574beba1b09ff244
parent3b2e908f28682cc31fcccb2c5f6c3ebf5095f888 (diff)
downloadsuil-f3893a6b82bd8d8729f9f42b3e33348bd4260abf.tar.gz
suil-f3893a6b82bd8d8729f9f42b3e33348bd4260abf.tar.bz2
suil-f3893a6b82bd8d8729f9f42b3e33348bd4260abf.zip
Fix potential memory leaks
-rw-r--r--src/x11_in_gtk2.c1
-rw-r--r--src/x11_in_gtk3.c1
2 files changed, 2 insertions, 0 deletions
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;
}
}