From 5d2aff9de0197694e68f869c8ea34514899cb04e Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer <eike@sf-mail.de> Date: Sat, 7 Oct 2017 23:18:27 +0200 Subject: [PATCH] ProcessWin32: use strdup() instead of open coding it --- ProcessWin32.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ProcessWin32.c b/ProcessWin32.c index 5183e3d2..9cd88687 100644 --- a/ProcessWin32.c +++ b/ProcessWin32.c @@ -713,11 +713,10 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int pipe, const char* file) *pfile = 0; } if (file) { - *pfile = (char*)malloc(strlen(file) + 1); + *pfile = strdup(file); if (!*pfile) { return 0; } - strcpy(*pfile, file); } /* If we are redirecting the pipe, do not share it or use a native -- GitLab