mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +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:
committed by
Carlos R. Mafra
parent
e5ebe0cb92
commit
3250826215
@@ -1196,6 +1196,8 @@ static void changeTextureForWorkspace(const char *domain, char *texture, int wor
|
|||||||
WMAddToPLArray(array, empty);
|
WMAddToPLArray(array, empty);
|
||||||
}
|
}
|
||||||
WMAddToPLArray(array, val);
|
WMAddToPLArray(array, val);
|
||||||
|
|
||||||
|
WMReleasePropList(empty);
|
||||||
} else {
|
} else {
|
||||||
WMDeleteFromPLArray(array, workspace);
|
WMDeleteFromPLArray(array, workspace);
|
||||||
WMInsertInPLArray(array, workspace, val);
|
WMInsertInPLArray(array, workspace, val);
|
||||||
@@ -1203,6 +1205,8 @@ static void changeTextureForWorkspace(const char *domain, char *texture, int wor
|
|||||||
|
|
||||||
value = WMGetPropListDescription(array, False);
|
value = WMGetPropListDescription(array, False);
|
||||||
updateDomain(domain, "WorkspaceSpecificBack", value);
|
updateDomain(domain, "WorkspaceSpecificBack", value);
|
||||||
|
|
||||||
|
WMReleasePropList(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
|
|||||||
Reference in New Issue
Block a user