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]

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


Hey guys ;)

It seems there are a lot of memory leaks in setup.exe :) The
patch above fixes just two very obvious ones - however there
seems to be a lot more of these. So I want  to know - am I blind
or there is some black magic which frees the memroy:

For example:

I cannot see where the "package" global variable is free-ed,
other thing I cannot see to be free-ed is the char pointers
from the "Info" structure which is part of the "Package" structure.
Perhaps there are more... If this really is a problem and I'm not
blind, i'd like to help finding and eliminating these memory
leaks from setup.exe.
--- /tmp/fromcwd.cc	Fri Nov  2 17:26:21 2001
+++ fromcwd.cc	Fri Nov  2 17:11:40 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]