rem: free(tmp);
add: wfree(tmp);
context: wIconChooserDialog(WScreen *scr, char **file, char *instance, char *class){    WWindow *wwin;    Window parent;    IconPanel *panel;    WMColor *color;    WMFont *boldFont;        panel = wmalloc(sizeof(IconPanel));    memset(panel, 0, sizeof(IconPanel));    panel->scr = scr;        panel->win = WMCreateWindow(scr->wmscreen, "iconChooser");    WMResizeWidget(panel->win, 450, 280);        boldFont = WMBoldSystemFontOfSize(scr->wmscreen, 12);    panel->normalfont = WMSystemFontOfSize(WMWidgetScreen(panel->win), 12);        panel->dirLabel = WMCreateLabel(panel->win);    WMResizeWidget(panel->dirLabel, 200, 20);    WMMoveWidget(panel->dirLabel, 10, 7);    WMSetLabelText(panel->dirLabel, _("Directories"));    WMSetLabelFont(panel->dirLabel, boldFont);    WMSetLabelTextAlignment(panel->dirLabel, WACenter);            WMSetLabelRelief(panel->dirLabel, WRSunken);    panel->iconLabel = WMCreateLabel(panel->win);    WMResizeWidget(panel->iconLabel, 140, 20);    WMMoveWidget(panel->iconLabel, 215, 7);    WMSetLabelText(panel->iconLabel, _("Icons"));    WMSetLabelFont(panel->iconLabel, boldFont);    WMSetLabelTextAlignment(panel->iconLabel, WACenter);    WMReleaseFont(boldFont);        color = WMWhiteColor(scr->wmscreen);    WMSetLabelTextColor(panel->dirLabel, color);     WMSetLabelTextColor(panel->iconLabel, color);    WMReleaseColor(color);    color = WMDarkGrayColor(scr->wmscreen);    WMSetWidgetBackgroundColor(panel->iconLabel, color);    WMSetWidgetBackgroundColor(panel->dirLabel, color);     WMReleaseColor(color);    WMSetLabelRelief(panel->iconLabel, WRSunken);    panel->dirList = WMCreateList(panel->win);    WMResizeWidget(panel->dirList, 200, 170);    WMMoveWidget(panel->dirList, 10, 30);    WMSetListAction(panel->dirList, listCallback, panel);        panel->iconList = WMCreateList(panel->win);    WMResizeWidget(panel->iconList, 140, 170);    WMMoveWidget(panel->iconList, 215, 30);     WMSetListAction(panel->iconList, listCallback, panel);    WMHangData(panel->iconList,panel);    panel->previewButton = WMCreateCommandButton(panel->win);    WMResizeWidget(panel->previewButton, 75, 26);    WMMoveWidget(panel->previewButton, 365, 130);    WMSetButtonText(panel->previewButton, _("Preview"));    WMSetButtonAction(panel->previewButton, buttonCallback, panel);    panel->iconView = WMCreateLabel(panel->win);    WMResizeWidget(panel->iconView, 75, 75);    WMMoveWidget(panel->iconView, 365, 40);    WMSetLabelImagePosition(panel->iconView, WIPOverlaps);    WMSetLabelRelief(panel->iconView, WRSunken);    WMSetLabelTextAlignment(panel->iconView, WACenter);    panel->fileLabel = WMCreateLabel(panel->win);    WMResizeWidget(panel->fileLabel, 80, 20);    WMMoveWidget(panel->fileLabel, 10, 210);    WMSetLabelText(panel->fileLabel, _("File Name:"));        panel->fileField = WMCreateTextField(panel->win);    WMResizeWidget(panel->fileField, 345, 20);    WMMoveWidget(panel->fileField, 95, 210);    WMSetTextFieldEditable(panel->fileField, False);        panel->okButton = WMCreateCommandButton(panel->win);    WMResizeWidget(panel->okButton, 80, 26);    WMMoveWidget(panel->okButton, 360, 240);    WMSetButtonText(panel->okButton, _("OK"));    WMSetButtonEnabled(panel->okButton, False);    WMSetButtonAction(panel->okButton, buttonCallback, panel);        panel->cancelButton = WMCreateCommandButton(panel->win);    WMResizeWidget(panel->cancelButton, 80, 26);    WMMoveWidget(panel->cancelButton, 270, 240);    WMSetButtonText(panel->cancelButton, _("Cancel"));    WMSetButtonAction(panel->cancelButton, buttonCallback, panel);#if 0    panel->chooseButton = WMCreateCommandButton(panel->win);    WMResizeWidget(panel->chooseButton, 110, 26);    WMMoveWidget(panel->chooseButton, 150, 240);    WMSetButtonText(panel->chooseButton, _("Choose File"));    WMSetButtonAction(panel->chooseButton, buttonCallback, panel);#endif    WMRealizeWidget(panel->win);    WMMapSubwidgets(panel->win);    parent = XCreateSimpleWindow(dpy, scr->root_win, 0, 0, 450, 280, 0, 0, 0);    XReparentWindow(dpy, WMWidgetXID(panel->win), parent, 0, 0);    {	char *tmp;	tmp = wmalloc((instance ? strlen(instance) : 0)		     + (class ? strlen(class) : 0) + 32);	if (tmp && (instance || class))	    sprintf(tmp, "%s [%s.%s]", _("Icon Chooser"), instance, class);	else	    strcpy(tmp, _("Icon Chooser"));	wwin = wManageInternalWindow(scr, parent, None, tmp,				     (scr->scr_width - 450)/2,				     (scr->scr_height - 280)/2, 450, 280);	free(tmp);    }        /* put icon paths in the list */    listIconPaths(panel->dirList);        WMMapWidget(panel->win);        wWindowMap(wwin);    while (!panel->done) {	XEvent event;		WMNextEvent(dpy, &event);	WMHandleEvent(&event);    }        if (panel->result) {	char *defaultPath, *wantedPath;	/* check if the file the user selected is not the one that	 * would be loaded by default with the current search path */	*file = WMGetListSelectedItem(panel->iconList)->text;	if ((*file)[0]==0) {	    free(*file);	    *file = NULL;	} else {	    defaultPath = FindImage(wPreferences.icon_path, *file);	    wantedPath = WMGetTextFieldText(panel->fileField);	    /* if the file is not the default, use full path */	    if (strcmp(wantedPath, defaultPath)!=0) {		*file = wantedPath;	    } else {		*file = wstrdup(*file);		free(wantedPath);	    }	    free(defaultPath);	}    } else {	*file = NULL;    }    WMReleaseFont(panel->normalfont);    WMUnmapWidget(panel->win);    WMDestroyWidget(panel->win);        wUnmanageWindow(wwin, False, False);    free(panel);    XDestroyWindow(dpy, parent);        return panel->result;}