* cygcheck.cc (add_path): Don't leak memory when path is already in ``paths''.

This commit is contained in:
Christopher Faylor 2004-10-10 17:07:23 +00:00
parent 7d032a010a
commit 76ad4d0a6e
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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++;
}