rem: free(newAtoms);
add: wfree(newAtoms);
context: WMSetWindowCloseAction(WMWindow *win, WMAction *action, void *clientData){    Atom *atoms = NULL;    Atom *newAtoms;    int count;    WMScreen *scr = win->view->screen;    if (win->view->flags.realized) {	if (action && !win->closeAction) {	    if (!XGetWMProtocols(scr->display, win->view->window, &atoms,				&count)) {		count = 0;	    }	    newAtoms = wmalloc((count+1)*sizeof(Atom));	    if (count > 0)		memcpy(newAtoms, atoms, count*sizeof(Atom));	    newAtoms[count++] = scr->deleteWindowAtom;	    XSetWMProtocols(scr->display, win->view->window, newAtoms, count);	    if (atoms)		XFree(atoms);	    free(newAtoms);	} else if (!action && win->closeAction) {	    int i, ncount;	    	    if (XGetWMProtocols(scr->display, win->view->window, &atoms, 				 &count) && count>0) {		newAtoms = wmalloc((count-1)*sizeof(Atom));		ncount = 0;		for (i=0; i < count; i++) {		    if (atoms[i]!=scr->deleteWindowAtom) {			newAtoms[i] = atoms[i];			ncount++;		    }		}		XSetWMProtocols(scr->display, win->view->window, newAtoms, 				ncount);		if (atoms)		    XFree(atoms);		free(newAtoms);	    }	}    }    win->closeAction = action;    win->closeData = clientData;    }