This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] setup.exe: removes some memory leaks from fromcwd.cc


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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]