Changeset: da4d5109e9fb for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=da4d5109e9fb
Modified Files:
        monetdb5/optimizer/opt_pipes.c
Branch: Feb2013
Log Message:

fixed leak(s) in opt_pipes


diffs (38 lines):

diff --git a/monetdb5/optimizer/opt_pipes.c b/monetdb5/optimizer/opt_pipes.c
--- a/monetdb5/optimizer/opt_pipes.c
+++ b/monetdb5/optimizer/opt_pipes.c
@@ -542,12 +542,8 @@ compileOptimizer(Client cntxt, str name)
                                                continue;
                                        MSinitClientPrg(&c, "user", 
pipes[j].name);
                                        msg = compileString(&sym, &c, 
pipes[j].def);
-                                       if (msg != MAL_SUCCEED) {
-                                               c.errbuf = NULL;
-                                               c.mythread = 0;
-                                               MCcloseClient(&c);
-                                               return msg;
-                                       }
+                                       if (msg != MAL_SUCCEED) 
+                                               break;
                                        pipes[j].mb = copyMalBlk(sym->def);
                                }
                        }
@@ -555,9 +551,17 @@ compileOptimizer(Client cntxt, str name)
                         * exist, just this client record is closed */
                        c.errbuf = NULL;
                        c.mythread = 0;
+                       /* destroy bstream using free */
+                       free(c.fdin->buf);
+                       free(c.fdin);
+                       /* remove garbage from previous connection */
+                       if (c.nspace) {
+                               freeModule(c.nspace);
+                               c.nspace = 0;
+                       }
                        MCcloseClient(&c);
-                       msg = validateOptimizerPipes();
-                       if (msg != MAL_SUCCEED)
+                       if (msg != MAL_SUCCEED || 
+                          (msg = validateOptimizerPipes()) != MAL_SUCCEED)
                                return msg;
                }
        }
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to