summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index 6485b8ff..f13f6ee2 100644
--- a/main.cpp
+++ b/main.cpp
@@ -702,9 +702,12 @@ int main(int argc,char **argv)
int exitCode = 0;
bool needsReset = false;
+ EthernetTapFactory *tapFactory = (EthernetTapFactory *)0;
+ RoutingTable *routingTable = (RoutingTable *)0;
+
try {
- EthernetTapFactory *tapFactory = ZTCreatePlatformEthernetTapFactory;
- RoutingTable *routingTable = ZTCreatePlatformRoutingTable;
+ tapFactory = ZTCreatePlatformEthernetTapFactory;
+ routingTable = ZTCreatePlatformRoutingTable;
node = new Node(homeDir,tapFactory,routingTable,udpPort,tcpPort,needsReset);
@@ -761,6 +764,9 @@ int main(int argc,char **argv)
exitCode = 3;
}
+ delete routingTable;
+ delete tapFactory;
+
#ifdef __UNIX_LIKE__
Utils::rm((std::string(homeDir)+"/zerotier-one.pid").c_str());
#endif