Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-10-10 21:07:23 +0400
committerChristopher Faylor <me@cgf.cx>2004-10-10 21:07:23 +0400
commit76ad4d0a6ec26ee476415a2a4742fbff4952916e (patch)
treee88d5aea95b15cea22efee868dd7db6017efc791 /winsup/utils/cygcheck.cc
parent7d032a010a4ba423d76fe5d0ff208125d903b400 (diff)
* cygcheck.cc (add_path): Don't leak memory when path is already in ``paths''.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r--winsup/utils/cygcheck.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index 17b9d948d..1c3ae4ab8 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -130,7 +130,10 @@ add_path (char *s, int maxlen)
*--e = 0;
for (int i = 1; i < num_paths; i++)
if (strcasecmp (paths[num_paths], paths[i]) == 0)
- return;
+ {
+ free (paths[num_paths]);
+ return;
+ }
num_paths++;
}