[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Fri Oct 3 18:51:04 CEST 2003


CVS commit by harris: 

Fixed bug #65413, regarding memory leaks.  The reporter not only let us 
know about the problem, but also diagnosed it with valgrind, and kindly 
provided a patch that fixed four memory leaks.  Each case was a missing 
'delete' command when 'new' had been called.  Thanks for the help, Rolf!

CCMAIL: 65413-done at bugs.kde.org
CCMAIL: kstars-devel at kde.org
  


  M +11 -6     kstarsdata.cpp   1.98
  M +2 -0      ksutils.cpp   1.16


--- kdeedu/kstars/kstars/kstarsdata.cpp  #1.97:1.98
@@ -325,6 +325,8 @@ while ( (c = (char) file.getch()) != -1)
       // Get host name
       ap = findXMLAtt(root, "name");
-      if (!ap)
+      if (!ap) {
+        delLilXML(xmlParser);
        return false;
+      }
 
        INDIHostsInfo *VInfo = new INDIHostsInfo;
@@ -335,7 +337,8 @@ while ( (c = (char) file.getch()) != -1)
       ap = findXMLAtt(root, "hostname");
 
-      if (!ap)
+      if (!ap) {
+        delLilXML(xmlParser);
        return false;
-
+      }
 
     VInfo->hostname = QString(ap->valu);
@@ -343,6 +346,8 @@ while ( (c = (char) file.getch()) != -1)
     ap = findXMLAtt(root, "port");
 
-     if (!ap)
+    if (!ap) {
+      delLilXML(xmlParser);
       return false;
+    }
 
     VInfo->portnumber = QString(ap->valu);

--- kdeedu/kstars/kstars/ksutils.cpp  #1.15:1.16
@@ -180,4 +180,6 @@ dms KSUtils::GSTat0hUT( const QDateTime 
         gst.setH( t1 );
 
+        delete num;
+
         return gst.reduce();
 }




More information about the Kstars-devel mailing list