[Monetdb-developers] [Monetdb-sql-checkins] sql/src/storage/bpm bpm_distribution.mx, , 1.1, 1.2

Stefan Manegold Stefan.Manegold at cwi.nl
Tue Jul 22 10:04:00 CEST 2008


On Tue, Jul 22, 2008 at 09:58:07AM +0200, Romulo Goncalves wrote:
> Stefan Manegold wrote:
> > On Mon, Jul 21, 2008 at 04:08:53PM +0000, Romulo Goncalves wrote:
> >> Update of /cvsroot/monetdb/sql/src/storage/bpm
> >> In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12270
> >>
> >> Modified Files:
> >> 	bpm_distribution.mx 
> >> Log Message:
> >> Use strdup to avoid problems with garbage on the string.
> >>
> > 
> > I suppose you do take care of the "garbage" that strdup() creates,
> > i.e., free() the malloc()'ed memory once it is not used any more ...
> The _DELETE functions is used when a bpmHost is destroyed.
> Does it free the memory?

I don't know the _DELETE functions --- simply look at them ...

I just noticed that your checkin creates one extra copy of each of these
strings, but I did not see any extra delete (free) calls; hence, (even) if
the original code did free the original strings (e.g., via the _DELETE
functions), it will not free your new copies, instead, but leave the
original strings behind creating leaks ...

Stefan

> Romulo
> > 
> > Stefan
> > 
> >> U bpm_distribution.mx
> >> Index: bpm_distribution.mx
> >> ===================================================================
> >> RCS file: /cvsroot/monetdb/sql/src/storage/bpm/bpm_distribution.mx,v
> >> retrieving revision 1.1
> >> retrieving revision 1.2
> >> diff -u -d -r1.1 -r1.2
> >> --- bpm_distribution.mx	19 Jan 2008 17:10:34 -0000	1.1
> >> +++ bpm_distribution.mx	21 Jul 2008 16:08:50 -0000	1.2
> >> @@ -90,11 +90,11 @@
> >>  	bpmHost bpmH = NULL;
> >>  	bpmH = ZNEW(bpmHostRec);
> >>  	bpmH->id = id;
> >> -	bpmH->host = host;
> >> +	bpmH->host = strdup(host);
> >>  	bpmH->port = port;
> >> -	bpmH->dbname = dbname;
> >> -	bpmH->user = user;
> >> -	bpmH->passwd = password;
> >> +	bpmH->dbname = strdup(dbname);
> >> +	bpmH->user = strdup(user);
> >> +	bpmH->passwd = strdup(password);
> >>  	bpmH->next = hostAnchor;
> >>  	hostAnchor = bpmH;
> >>  
> >>
> >>
> >> -------------------------------------------------------------------------
> >> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> >> Build the coolest Linux based applications with Moblin SDK & win great prizes
> >> Grand prize is a trip for two to an Open Source event anywhere in the world
> >> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> _______________________________________________
> >> Monetdb-sql-checkins mailing list
> >> Monetdb-sql-checkins at lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins
> >>
> >>
> >>
> >>
> >>
> >>
> > 
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Monetdb-developers mailing list
> Monetdb-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers
> 

-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list