rem: free(panel->imageFile);
add: wfree(panel->imageFile);
context: SetTexturePanelTexture(TexturePanel *panel, char *name, proplist_t texture){    WMScreen *scr = WMWidgetScreen(panel->win);    char *str, *type;    proplist_t p;    WMColor *color;    int i;    char buffer[64];    int gradient = 0;    WMSetTextFieldText(panel->nameT, name);    if (!texture)	return;    p = PLGetArrayElement(texture, 0);    if (!p) {	goto bad_texture;    }    type = PLGetString(p);    /*...............................................*/    if (strcasecmp(type, "solid")==0) {	WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SOLID);	p = PLGetArrayElement(texture, 1);	if (!p) {	    str = "black";	} else {	    str = PLGetString(p);	}	color = WMCreateNamedColor(scr, str, False);	WMSetColorWellColor(panel->defcW, color);	WMReleaseColor(color);    /*...............................................*/    } else if (strcasecmp(type, "hgradient")==0	       || strcasecmp(type, "vgradient")==0	       || strcasecmp(type, "dgradient")==0) {	WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_SGRADIENT);	p = PLGetArrayElement(texture, 1);	if (!p) {	    str = "black";	} else {	    str = PLGetString(p);	}	color = WMCreateNamedColor(scr, str, False);	WMSetColorWellColor(panel->tcol1W, color);	WMReleaseColor(color);	p = PLGetArrayElement(texture, 2);	if (!p) {	    str = "black";	} else {	    str = PLGetString(p);	}	color = WMCreateNamedColor(scr, str, False);	WMSetColorWellColor(panel->tcol2W, color);	WMReleaseColor(color);	gradient = type[0];    /*...............................................*/    } else if (strcasecmp(type, "thgradient")==0	       || strcasecmp(type, "tvgradient")==0	       || strcasecmp(type, "tdgradient")==0) {	int i;	WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_TGRADIENT);	gradient = type[1];	WMSetTextFieldText(panel->imageT,			   PLGetString(PLGetArrayElement(texture, 1)));	if (panel->imageFile)	    free(panel->imageFile);	panel->imageFile = wstrdup(PLGetString(PLGetArrayElement(texture, 1)));	i = 180;	sscanf(PLGetString(PLGetArrayElement(texture, 2)), "%i", &i);	WMSetSliderValue(panel->topaS, i);	p = PLGetArrayElement(texture, 3);	if (!p) {	    str = "black";	} else {	    str = PLGetString(p);	}	color = WMCreateNamedColor(scr, str, False);	WMSetColorWellColor(panel->tcol1W, color);	WMReleaseColor(color);	p = PLGetArrayElement(texture, 4);	if (!p) {	    str = "black";	} else {	    str = PLGetString(p);	}	color = WMCreateNamedColor(scr, str, False);	WMSetColorWellColor(panel->tcol2W, color);	WMReleaseColor(color);		WMSetTextFieldText(panel->imageT,			   PLGetString(PLGetArrayElement(texture, 1)));	    if (panel->imageFile)        free(panel->imageFile);    if ((panel->imageFile = wfindfileinarray(panel->pathList,                PLGetString(PLGetArrayElement(texture, 1)))) != NULL) {        panel->image = RLoadImage(WMScreenRContext(scr), panel->imageFile, 0);        updateTGradImage(panel);        updateSGradButtons(panel);    } else wwarning("could not load file '%s': %s", panel->imageFile,		     RMessageForError(RErrorCode));    /*...............................................*/    } else if (strcasecmp(type, "mhgradient")==0	       || strcasecmp(type, "mvgradient")==0	       || strcasecmp(type, "mdgradient")==0) {	WMListItem *item;	for (i = 0; i < WMGetListNumberOfRows(panel->gcolL); i++) {	    item = WMGetListItem(panel->gcolL, i);	    free(item->clientData);	}	WMClearList(panel->gcolL);	WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_GRADIENT);	p = PLGetArrayElement(texture, 1);	if (!p) {	    str = "black";	} else {	    str = PLGetString(p);	}	color = WMCreateNamedColor(scr, str, False);	WMSetColorWellColor(panel->defcW, color);	WMReleaseColor(color);	for (i = 2; i < PLGetNumberOfElements(texture); i++) {	    RColor *rgb;	    XColor xcolor;	    p = PLGetArrayElement(texture, i);	    if (!p) {		str = "black";	    } else {		str = PLGetString(p);	    }	    XParseColor(WMScreenDisplay(scr), WMScreenRContext(scr)->cmap,			str, &xcolor);	    rgb = wmalloc(sizeof(RColor));	    rgb->red = xcolor.red >> 8;	    rgb->green = xcolor.green >> 8;	    rgb->blue = xcolor.blue >> 8;	    sprintf(buffer, "%02x,%02x,%02x", rgb->red, rgb->green, rgb->blue);	    item = WMAddListItem(panel->gcolL, buffer);	    item->clientData = rgb;	}	sliderChangeCallback(panel->ghueS, panel);	gradient = type[1];    /*...............................................*/    } else if (strcasecmp(type, "cpixmap")==0	       || strcasecmp(type, "spixmap")==0	       || strcasecmp(type, "mpixmap")==0	       || strcasecmp(type, "tpixmap")==0) {	WMSetPopUpButtonSelectedItem(panel->typeP, TYPE_PIXMAP);	switch (toupper(type[0])) {	 case 'C':	    WMSetPopUpButtonSelectedItem(panel->arrP, PTYPE_CENTER);	    break;	 case 'S':	    WMSetPopUpButtonSelectedItem(panel->arrP, PTYPE_SCALE);	    break;	 case 'M':	    WMSetPopUpButtonSelectedItem(panel->arrP, PTYPE_MAXIMIZE);	    break;	 default:	 case 'T':	    WMSetPopUpButtonSelectedItem(panel->arrP, PTYPE_TILE);	    break;	}	WMSetTextFieldText(panel->imageT,			   PLGetString(PLGetArrayElement(texture, 1)));		if (panel->imageFile)	    free(panel->imageFile);	panel->imageFile = wfindfileinarray(panel->pathList,			    PLGetString(PLGetArrayElement(texture, 1)));	color = WMCreateNamedColor(scr,			   PLGetString(PLGetArrayElement(texture, 2)), False);	WMSetColorWellColor(panel->defcW, color);	WMReleaseColor(color);	updateImage(panel, panel->imageFile);    }    changeTypeCallback(panel->typeP, panel);    if (gradient > 0) {	updateGradButtons(panel);	switch (toupper(gradient)) {	 case 'H':	    WMPerformButtonClick(panel->dirhB);	    break;	 case 'V':	    WMPerformButtonClick(panel->dirvB);	    break;	 default:	 case 'D':	    WMPerformButtonClick(panel->dirdB);	    break;	}    }    return; bad_texture:    str = PLGetDescription(texture);    wwarning("error creating texture %s", str);    free(str);}