Changeset: e27d94e78b74 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e27d94e78b74
Modified Files:
        monetdb5/mal/mal_runtime.c
Branch: userprofile
Log Message:

fix memory leak


diffs (22 lines):

diff --git a/monetdb5/mal/mal_runtime.c b/monetdb5/mal/mal_runtime.c
--- a/monetdb5/mal/mal_runtime.c
+++ b/monetdb5/mal/mal_runtime.c
@@ -88,6 +88,8 @@ updateUserStats(Client cntxt, MalBlkPtr 
        if (USRstats[idx].username == NULL || USRstats[idx].user != cntxt->user 
|| strcmp(USRstats[idx].username, cntxt->username) != 0) {
                if (USRstats[idx].username)
                        GDKfree(USRstats[idx].username);
+               if (USRstats[idx].maxquery)
+                       GDKfree(USRstats[idx].maxquery);
                clearUSRstats(idx);
                USRstats[idx].user = cntxt->user;
                USRstats[idx].username = GDKstrdup(cntxt->username);
@@ -98,7 +100,8 @@ updateUserStats(Client cntxt, MalBlkPtr 
                USRstats[idx].started = started;
                USRstats[idx].finished = finished;
                USRstats[idx].maxticks = ticks;
-               GDKfree(USRstats[idx].maxquery);
+               if (USRstats[idx].maxquery)
+                       GDKfree(USRstats[idx].maxquery);
                USRstats[idx].maxquery = GDKstrdup(query);
        }
 }
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to