From 76ad4d0a6ec26ee476415a2a4742fbff4952916e Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Sun, 10 Oct 2004 17:07:23 +0000 Subject: [PATCH] * cygcheck.cc (add_path): Don't leak memory when path is already in ``paths''. --- winsup/utils/ChangeLog | 5 +++++ winsup/utils/cygcheck.cc | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog index 5724ec689..7ee31d60a 100644 --- a/winsup/utils/ChangeLog +++ b/winsup/utils/ChangeLog @@ -1,3 +1,8 @@ +2004-10-10 Bas van Gompel + + * cygcheck.cc (add_path): Don't leak memory when path is already in + ``paths''. + 2004-10-10 Bas van Gompel * cygcheck.cc (dump_sysinfo): Warn about trailing (back)slash on mount 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++; }