Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18604/src/mal

Modified Files:
      Tag: MonetDB_5-2
        mal_builder.mx 
Log Message:
pushStr shouldn't do a GDKstrdup, as it may return an equal string from
the constant cache, ie only if the returned variable holds the given string
(poniters are equal) we do a string dup. This solves another memory leak.


Index: mal_builder.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_builder.mx,v
retrieving revision 1.26
retrieving revision 1.26.2.1
diff -u -d -r1.26 -r1.26.2.1
--- mal_builder.mx      28 Aug 2007 19:56:41 -0000      1.26
+++ mal_builder.mx      29 Oct 2007 07:09:40 -0000      1.26.2.1
@@ -260,10 +260,12 @@
        ValRecord cst;
 
        cst.vtype= TYPE_str;
-       cst.val.sval= GDKstrdup(val);
+       cst.val.sval= val;
        cst.len= strlen(cst.val.sval);
        _t = defConstant(mb,TYPE_str,&cst);
 
+       if (getConstant(mb,_t).val.sval == val) 
+               getConstant(mb,_t).val.sval = GDKstrdup(val);
        return pushArgument(mb, q, _t);
 }
 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to