Changeset: 6449a093cb4b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6449a093cb4b
Modified Files:
        sql/backends/monet5/sql_statistics.c
Branch: Apr2019
Log Message:

Plug a memory leak.


diffs (26 lines):

diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -58,7 +58,7 @@ str
 sql_drop_statistics(Client cntxt, sql_table *t)
 {
        node *ncol;
-       char *dquery, *msg;
+       char *dquery, *msg = NULL;
 
        dquery = (char *) GDKzalloc(96);
        if (dquery == NULL) {
@@ -71,10 +71,11 @@ sql_drop_statistics(Client cntxt, sql_ta
                        snprintf(dquery, 96, "delete from sys.statistics where 
\"column_id\" = %d;", c->base.id);
                        msg = SQLstatementIntern(cntxt, &dquery, "SQLanalyze", 
TRUE, FALSE, NULL);
                        if (msg)
-                               return msg;
+                               break;
                }
        }
-       return NULL;
+       GDKfree(dquery);
+       return msg;
 }
 
 str
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to