From 903eac50a5425f3937cd2b384fd7e2347d065178 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 2 Mar 2015 14:09:29 +0300 Subject: [PATCH] convert(): use the elegant realloc() call Instead of doing a poor man's realloc(), we can call the real thing ;-) Signed-off-by: Johannes Schindelin --- winsup/cygwin/path.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 43dee06649..1807847cff 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3466,8 +3466,7 @@ arg_heuristic_with_exclusions (char const * const arg, char const * exclusions, { return ((char *)arg); } - arg_result = (char *)malloc (strlen (stack_path)+1); - strcpy (arg_result, stack_path); + arg_result = (char *)realloc (stack_path, strlen (stack_path)+1); // Windows doesn't like empty entries in PATH env. variables (;;) char* semisemi = strstr(arg_result, ";;"); while (semisemi)