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.
This commit is contained in:
Fabian Maurer 2024-01-06 21:39:25 +01:00 committed by Alexandre Julliard
parent 83bcb752a2
commit ed18b66ceb

View file

@ -437,7 +437,7 @@ static HRESULT parse_text( struct path *path, ULONG mode, const WCHAR *text )
} }
if (path->num_namespaces) 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; if (!(path->len_namespaces = malloc( path->num_namespaces * sizeof(int) ))) goto done;
i = 0; i = 0;