diff --git a/storage/connect/connect.cc b/storage/connect/connect.cc index d3e8f77ed8f..a0121556920 100755 --- a/storage/connect/connect.cc +++ b/storage/connect/connect.cc @@ -74,15 +74,12 @@ PGLOBAL CntExit(PGLOBAL g) PDBUSER dup= PlgGetUser(g); CntEndDB(g); - PlugExit(g); - - if (dup->Catalog) { - delete dup->Catalog; - dup->Catalog= NULL; - } // endif - free(dup); - free(g->Activityp); + + if (g->Activityp) + delete g->Activityp; + + PlugExit(g); g= NULL; } // endif g diff --git a/storage/connect/plugutil.c b/storage/connect/plugutil.c index 4415dea1f56..2455e73b1d2 100644 --- a/storage/connect/plugutil.c +++ b/storage/connect/plugutil.c @@ -173,13 +173,10 @@ PGLOBAL PlugInit(LPCSTR Language, uint worksize) /***********************************************************************/ int PlugExit(PGLOBAL g) { - int rc = 0; - PACTIVITY ap; + int rc = 0; if (!g) return rc; - else - ap = g->ActivityStart; free(g->Sarea); free(g);