From: John Tsiombikas Date: Mon, 11 Oct 2021 12:19:09 +0000 (+0300) Subject: fixed small memory leaks (missing XFree calls after XGetProperty/XGetWMName) X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;ds=sidebyside;h=d6833c2db04aefb3fd972af7e723e0975fba7181;p=miniglut fixed small memory leaks (missing XFree calls after XGetProperty/XGetWMName) --- diff --git a/miniglut.c b/miniglut.c index c362882..6ea9b4e 100644 --- a/miniglut.c +++ b/miniglut.c @@ -715,18 +715,20 @@ static int have_netwm_fullscr(void) int fmt; long offs = 0; unsigned long i, count, rem; - Atom prop[8], type; + Atom *prop, type; Atom xa_net_supported = XInternAtom(dpy, "_NET_SUPPORTED", False); do { XGetWindowProperty(dpy, root, xa_net_supported, offs, 8, False, AnyPropertyType, - &type, &fmt, &count, &rem, (unsigned char**)prop); + &type, &fmt, &count, &rem, (unsigned char**)&prop); for(i=0; i 0); @@ -1095,9 +1097,11 @@ static Window get_daemon_window(Display *dpy) win = *(Window*)prop; XFree(prop); + wname.value = 0; if(!XGetWMName(dpy, win, &wname) || mglut_strcmp("Magellan Window", (char*)wname.value) != 0) { - return 0; + win = 0; } + XFree(wname.value); return win; }