1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

util: fix leaks in wmsetbg's changeTextureForWorkspace (Coverity #50169)

As pointed by Coverity, some locally created PropList objects are not freed
when the function returns. The truth is their refCount is 1 more than what
they should be, but that's more than what Coverity can detect today.

This patch adds the appropriate release calls when they are not needed
anymore, which will actually not free them but get their refCount right so
they will be freed as soon as the PropList in which they are used are
released.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-06-16 20:15:24 +02:00
committed by Carlos R. Mafra
parent e5ebe0cb92
commit 3250826215

View File

@@ -1196,6 +1196,8 @@ static void changeTextureForWorkspace(const char *domain, char *texture, int wor
WMAddToPLArray(array, empty);
}
WMAddToPLArray(array, val);
WMReleasePropList(empty);
} else {
WMDeleteFromPLArray(array, workspace);
WMInsertInPLArray(array, workspace, val);
@@ -1203,6 +1205,8 @@ static void changeTextureForWorkspace(const char *domain, char *texture, int wor
value = WMGetPropListDescription(array, False);
updateDomain(domain, "WorkspaceSpecificBack", value);
WMReleasePropList(array);
}
int main(int argc, char **argv)