diff options
author | Christopher Faylor <me@cgf.cx> | 2004-10-10 17:07:23 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-10-10 17:07:23 +0000 |
commit | 76ad4d0a6ec26ee476415a2a4742fbff4952916e (patch) | |
tree | e88d5aea95b15cea22efee868dd7db6017efc791 /winsup | |
parent | 7d032a010a4ba423d76fe5d0ff208125d903b400 (diff) | |
download | newlib-76ad4d0a6ec26ee476415a2a4742fbff4952916e.zip newlib-76ad4d0a6ec26ee476415a2a4742fbff4952916e.tar.gz newlib-76ad4d0a6ec26ee476415a2a4742fbff4952916e.tar.bz2 |
* cygcheck.cc (add_path): Don't leak memory when path is already in ``paths''.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/utils/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/utils/cygcheck.cc | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 5724ec6..7ee31d6 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,5 +1,10 @@ 2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + * cygcheck.cc (add_path): Don't leak memory when path is already in + ``paths''. + +2004-10-10 Bas van Gompel <cygwin-patch.buzz@bavag.tmfweb.nl> + * cygcheck.cc (dump_sysinfo): Warn about trailing (back)slash on mount entries. diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index 17b9d94..1c3ae4a 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++; } |