diff --git a/src/library/portlookup.cpp b/src/library/portlookup.cpp index 6365b96..dfd12e4 100644 --- a/src/library/portlookup.cpp +++ b/src/library/portlookup.cpp @@ -1,6 +1,6 @@ #include "portlookup.h" #include -#include + using namespace sysadm; PortLookUp::PortInfo PortLookUp::LookUpPort(int portNumber) { @@ -67,6 +67,16 @@ PortLookUp::PortInfo PortLookUp::LookUpPort(int portNumber) } +PortLookUp::PortLookUp() +{ + readServiceFile(); +} + +PortLookUp::~PortLookUp() +{ + delete portStrings; +} + void PortLookUp::readServicesFile() { portStrings = new QStringList(); @@ -88,5 +98,6 @@ void PortLookUp::readServicesFile() portStrings->append(line); } services->close(); + delete services; } diff --git a/src/library/portlookup.h b/src/library/portlookup.h index 9638ba1..4ac4c9b 100644 --- a/src/library/portlookup.h +++ b/src/library/portlookup.h @@ -30,6 +30,7 @@ public: * @ErrorConditions Port Number is set to -1 and a description of the error is stored in the description variable */ PortInfo LookUpPort(int portNumber); + ~PortLookUp(); private: void readServicesFile();