Changeset: 5f306f869b70 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5f306f869b70
Modified Files:
        sql/backends/monet5/sql_gencode.c
Branch: Jun2016
Log Message:

Potential memory leaks.


diffs (27 lines):

diff --git a/sql/backends/monet5/sql_gencode.c 
b/sql/backends/monet5/sql_gencode.c
--- a/sql/backends/monet5/sql_gencode.c
+++ b/sql/backends/monet5/sql_gencode.c
@@ -3112,8 +3112,10 @@ backend_create_sql_func(backend *be, sql
                        int varid = 0;
                        char *buf = GDKmalloc(MAXIDENTLEN);
 
-                       if (buf == NULL)
+                       if (buf == NULL) {
+                               sa_destroy(sa);
                                return -1;
+                       }
                        if (a->name)
                                (void) snprintf(buf, MAXIDENTLEN, "A%s", 
a->name);
                        else
@@ -3126,8 +3128,10 @@ backend_create_sql_func(backend *be, sql
        }
        /* announce the transaction mode */
 
-       if (backend_dumpstmt(be, curBlk, s, 0, 1) < 0)
+       if (backend_dumpstmt(be, curBlk, s, 0, 1) < 0) {
+               sa_destroy(sa);
                return -1;
+       }
        /* selectively make functions available for inlineing */
        /* for the time being we only inline scalar functions */
        /* and only if we see a single return value */
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to