Fix Coverity 10050
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Feb 2011 09:38:58 +0000 (09:38 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Feb 2011 09:38:58 +0000 (09:38 +0000)
TTherminator/Therminator/ReadPar.cxx
TTherminator/Therminator/ReadPar.h

index cb193f2..2242e25 100644 (file)
@@ -30,6 +30,7 @@
 #include <fstream>
 #include <sstream>
 #include <iosfwd>
+#include <stdlib.h>
 
 ReadPar::ReadPar()
 {
@@ -42,6 +43,12 @@ ReadPar::ReadPar(const char *aFName)
   readFile(aFName);
 }
 
+ReadPar::~ReadPar()
+{
+  if (fname)
+    free(fname);
+}
+
 int ReadPar::readFile(const char *aFName) throw (int)
 {
   option read_opt;
index 31a7457..de7be1c 100644 (file)
@@ -57,6 +57,7 @@ class ReadPar
  public:
   ReadPar(); // Default constructor
   ReadPar(const char *aFName);
+  ~ReadPar();
   
   int readFile(const char *aFName) throw(int); 
   int printOptions();