]> git.draconx.ca Git - rrace.git/commitdiff
Fix memory leak in ewmh_probe_wm_icon.
authorNick Bowler <nbowler@draconx.ca>
Fri, 23 Dec 2022 07:01:36 +0000 (02:01 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 23 Dec 2022 07:03:00 +0000 (02:03 -0500)
The data returned by XGetWindowProperty must be freed by the caller;
this didn't happen so there is a small leak in this function.  Simple
enough to fix.

src/ewmhicon.c

index e0ab8a58b1bb41f63f4f0e6419b240e8cf2aa2d2..319ed3ac548e746c9df3e92f9a850cf3774a78ae 100644 (file)
@@ -152,9 +152,11 @@ int ewmh_probe_wm_icon(Widget shell)
                props = (void *)prop_return;
                for (i = 0; i < nitems; i++) {
                        if (props[i] == net_wm_icon) {
+                               XFree(props);
                                return 1;
                        }
                }
+               XFree(props);
        } while (nitems > 0 && bytes_after > 0);
 
        return 0;