From 0eaa43f6afa4e4c407b6c036c153e01719bc018b Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 14 Sep 2021 23:11:48 +0300 Subject: [PATCH] msvcrt: Use free() on msvcrt_wstrdupa() results (Coverity). Signed-off-by: Nikolay Sivov Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/msvcrt/process.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/msvcrt/process.c b/dlls/msvcrt/process.c index cf1dcd3d279..a5f8f0bca3d 100644 --- a/dlls/msvcrt/process.c +++ b/dlls/msvcrt/process.c @@ -1165,14 +1165,14 @@ FILE* CDECL _popen(const char* command, const char* mode) if (!(cmdW = msvcrt_wstrdupa(command))) return NULL; if (!(modeW = msvcrt_wstrdupa(mode))) { - HeapFree(GetProcessHeap(), 0, cmdW); + free(cmdW); return NULL; } ret = _wpopen(cmdW, modeW); - HeapFree(GetProcessHeap(), 0, cmdW); - HeapFree(GetProcessHeap(), 0, modeW); + free(cmdW); + free(modeW); return ret; } @@ -1274,7 +1274,7 @@ int CDECL system(const char* cmd) if ((cmdW = msvcrt_wstrdupa(cmd))) { res = _wsystem(cmdW); - HeapFree(GetProcessHeap(), 0, cmdW); + free(cmdW); } return res; }