Module: wine Branch: master Commit: ed18b66ceb43d472339ff584cd26154497e04d1c URL: https://gitlab.winehq.org/wine/wine/-/commit/ed18b66ceb43d472339ff584cd26154... Author: Fabian Maurer <dark.shadow4(a)web.de> Date: Sat Jan 6 21:39:25 2024 +0100 wmiutils: Always zero path->namespaces in parse_text (Coverity). When the malloc for len_namespaces should fail namespaces would be uninitialized and passed to free. --- dlls/wmiutils/path.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/wmiutils/path.c b/dlls/wmiutils/path.c index 0f0263c9536..48b79ccdb23 100644 --- a/dlls/wmiutils/path.c +++ b/dlls/wmiutils/path.c @@ -437,7 +437,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text ) } if (path->num_namespaces) { - if (!(path->namespaces = malloc( path->num_namespaces * sizeof(WCHAR *) ))) goto done; + if (!(path->namespaces = calloc( path->num_namespaces, sizeof(WCHAR *) ))) goto done; if (!(path->len_namespaces = malloc( path->num_namespaces * sizeof(int) ))) goto done; i = 0;