From ed18b66ceb43d472339ff584cd26154497e04d1c Mon Sep 17 00:00:00 2001 From: Fabian Maurer Date: Sat, 6 Jan 2024 21:39:25 +0100 Subject: [PATCH] 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;