delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/02/11:40:05

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3BE2CC48.47462EC6@syntrex.com>
Date: Fri, 02 Nov 2001 17:39:36 +0100
From: Pavel Tsekov <ptsekov AT syntrex DOT com>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: [PATCH] setup.exe: removes some memory leaks from fromcwd.cc

--------------15E6E452380BD93703A01F7C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

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.
--------------15E6E452380BD93703A01F7C
Content-Type: text/plain; charset=us-ascii;
 name="fromcwd.cc.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="fromcwd.cc.diff"

--- /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;
 }
 


--------------15E6E452380BD93703A01F7C
Content-Type: text/plain; charset=us-ascii

--
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/
--------------15E6E452380BD93703A01F7C--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019