Changeset: 6e9ac0c14afd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6e9ac0c14afd
Modified Files:
        monetdb5/mal/mal_debugger.c
        tools/mserver/shutdowntest.c
Branch: default
Log Message:

Plug some holes.


diffs (46 lines):

diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -66,11 +66,12 @@ mdbInit(void)
        /*
         * Each client has its own breakpoint administration, kept in a
         * global table.  Although a little space consumptive, it is the
-        * easiest to maintain and much less expensive as reserving debugger
-        * space in each instruction.
+        * easiest to maintain and much less expensive than reserving
+        * debugger space in each instruction.
         */
-       mdbTable = GDKzalloc(sizeof(mdbStateRecord) * MAL_MAXCLIENTS);
-       if (mdbTable == NULL) {
+       if (mdbTable)
+               memset(mdbTable, 0, sizeof(mdbStateRecord) * MAL_MAXCLIENTS);
+       else if ((mdbTable = GDKzalloc(sizeof(mdbStateRecord) * 
MAL_MAXCLIENTS)) == NULL) {
                showException(GDKout,MAL, "mdbInit",MAL_MALLOC_FAIL);
                return -1;
        }
diff --git a/tools/mserver/shutdowntest.c b/tools/mserver/shutdowntest.c
--- a/tools/mserver/shutdowntest.c
+++ b/tools/mserver/shutdowntest.c
@@ -90,7 +90,7 @@ static void monetdb_disconnect(void* con
 
 static str monetdb_initialize(void) {
        opt *set = NULL;
-       volatile int setlen = 0;
+       int setlen = 0;
        str retval = MAL_SUCCEED;
        char prmodpath[1024];
        char *modpath = NULL;
@@ -261,8 +261,13 @@ static str monetdb_initialize(void) {
                retval = monetdb_query(c, query);
                monetdb_disconnect(c);
        }
+
+       mo_free_options(set, setlen);
+
        return MAL_SUCCEED;
 cleanup:
+       if (set)
+               mo_free_options(set, setlen);
        monetdb_initialized = 0;
        return retval;
 }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to