This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: [PATCH] setup.exe: removes some memory leaks from fromcwd.cc
- To: Robert Collins <robert dot collins at itdomain dot com dot au>
- Subject: Re: [PATCH] setup.exe: removes some memory leaks from fromcwd.cc
- From: Pavel Tsekov <ptsekov at syntrex dot com>
- Date: Mon, 05 Nov 2001 11:04:31 +0100
- CC: cygwin at cygwin dot com
- References: <3BE2CC48.47462EC6@syntrex.com> <1004743324.9086.39.camel@lifelesswks>
Robert Collins wrote:
>
[ snip ]
> I haven't committed this leak - no changelog.
Good, cause I've messed it - I'm an idiot :(. Attached is the right one.
And here is the Changelog entry.
2001-11-05 Pavel Tsekov <ptsekov@syntrex.com>
* fromcwd.cc (found_file): free() memory containing the version and
filepath
information for a given package, before replacing the pointers which
reference
this memory.
--- /tmp/fromcwd.cc Fri Nov 2 17:26:21 2001
+++ /tmp/Src/cygwin-snapshot-20011018-1/winsup/cinstall/fromcwd.cc Mon Nov 5 10:56:56 2001
@@ -116,8 +116,14 @@ found_file (char *path, unsigned int fsi
return;
}
+ if (p->info[trust].version)
+ free(p->info[trust].version);
p->info[trust].version = _strdup (f.ver);
+
+ if (p->info[trust].install)
+ free(p->info[trust].install);
p->info[trust].install = _strdup (path);
+
p->info[trust].install_size = fsize;
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/