1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-26 16:32:30 +01:00

Coverity: fix util wmsetbg resource leak

This commit is contained in:
David Maciejak
2023-03-03 13:18:53 +08:00
committed by Carlos R. Mafra
parent 35f87b5592
commit 7475bc5d0a

View File

@@ -505,7 +505,15 @@ static BackgroundTexture *parseTexture(RContext * rc, char *text)
iheight = image->height;
}
GETSTRORGOTO(val, tmp, 2, error);
/* cannot use GETSTRORGOTO() here
* as we have to free image in case of error */
val = WMGetFromPLArray(texarray, 2);
if (!WMIsPLString(val)) {
wwarning("could not parse texture %s", text);
RReleaseImage(image);
goto error;
}
tmp = WMGetFromPLString(val);
if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) {
wwarning("could not parse color %s in texture %s", tmp, text);