Re: [Monetdb-developers] [Monetdb-checkins] clients/src/mapiclient MapiClient.mx, , 1.96, 1.97
On 2007-12-13 19:35, Niels Nes wrote:
Update of /cvsroot/monetdb/clients/src/mapiclient In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv17600/src/mapiclient
Modified Files: MapiClient.mx Log Message: don't leak memory
Index: MapiClient.mx =================================================================== RCS file: /cvsroot/monetdb/clients/src/mapiclient/MapiClient.mx,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- MapiClient.mx 13 Dec 2007 15:44:24 -0000 1.96 +++ MapiClient.mx 13 Dec 2007 18:35:21 -0000 1.97 @@ -1224,6 +1224,8 @@ fflush(stdout); } #endif + if (buf != oldbuf) + free(buf); buf = oldbuf; line = fgets(buf, BUFSIZ, fp); } @@ -1237,7 +1239,7 @@ line = to; iconv(cd_in, &from, &fromlen, &to, &tolen); *to = 0; - if (oldbuf) + if (!oldbuf)
I prefer oldbuf == NULL. oldbuf is not a Boolean.
free(buf); buf = line; }
------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Monetdb-checkins mailing list Monetdb-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-checkins
-- Sjoerd Mullender
participants (1)
-
Sjoerd Mullender