Index: trunk/MagicSoft/Mars/msql/MSQLServer.cc
===================================================================
--- trunk/MagicSoft/Mars/msql/MSQLServer.cc	(revision 4114)
+++ trunk/MagicSoft/Mars/msql/MSQLServer.cc	(revision 4513)
@@ -31,4 +31,9 @@
 //  many features usefull working with relational tables.
 //
+//  Use it like TSQlServer:
+//    new MSQLServer("mysql://localhost:3306", "hercules", "stdmagicpassword");
+//    // now start your TBrowser
+//    new TBrowser;
+//
 ////////////////////////////////////////////////////////////////////////
 #include "MSQLServer.h"
@@ -72,5 +77,5 @@
     const TString desc((*row)[1]);
 
-    //cout << "Column Type: " << desc << endl;
+    delete res;
 
     const Bool_t isnum =
@@ -119,4 +124,6 @@
         num++;
     }
+
+    delete res;
 
     if (!isnum)
@@ -297,5 +304,8 @@
     TSQLResult *res = fServ->Query(query);
     if (res)
+    {
         PrintTable(res);
+        delete res;
+    }
     else
         cout << "Query failed: " << query << endl;
@@ -519,16 +529,30 @@
 
     if (res->GetFieldCount()!=1)
+    {
+        delete res;
         return (PrintError("GetEntry - Number of columns != 1", query), "");
+    }
 
     if (res->GetRowCount()>1)
+    {
+        delete res;
         return (PrintError("GetEntry - Number of rows > 1", query), "");
+    }
 
     if (res->GetRowCount()==0)
+    {
+        delete res;
         return "";
+    }
 
     const char *fld = res->Next()->GetField(0);
     if (!fld)
+    {
+        delete res;
         return (PrintError("GetEntry - Entry is empty", query), "");
-
-    return TString(fld);
-}
+    }
+
+    const TString rc(fld);
+    delete res;
+    return rc;
+}
