Skip to content

Commit

Permalink
Moved ifname release that was deleted too early
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Dec 17, 2018
1 parent e08798c commit 1a01c4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/NetworkInterface.cpp
Expand Up @@ -561,12 +561,6 @@ void NetworkInterface::deleteDataStructures() {
}
#endif

if(ifname) {
//ntop->getTrace()->traceEvent(TRACE_NORMAL, "Interface %s shutdown", ifname);
free(ifname);
ifname = NULL;
}

#ifdef HAVE_EBPF
if(ebpfEvents) {
for(u_int16_t i=0; i<EBPF_QUEUE_LEN; i++)
Expand All @@ -592,6 +586,8 @@ NetworkInterface::~NetworkInterface() {
}
#endif

if(db) db->shutdown();

if(getNumPackets() > 0) {
ntop->getTrace()->traceEvent(TRACE_NORMAL,
"Flushing host contacts for interface %s",
Expand Down Expand Up @@ -644,6 +640,8 @@ NetworkInterface::~NetworkInterface() {
if(tsExporter) delete tsExporter;
if(ts_ring) delete ts_ring;
if(mdns) delete mdns; /* Leave it at the end so the mdns resolved has time to initialize */

if(ifname) free(ifname);
}

/* **************************************************** */
Expand Down
1 change: 0 additions & 1 deletion src/Ntop.cpp
Expand Up @@ -1388,7 +1388,6 @@ bool Ntop::checkGuiUserPassword(struct mg_connection *conn,
char *remote_ip, ipbuf[64], key[128], val[16];
int cur_attempts = 0;
bool rv;
struct mg_request_info *request_info = mg_get_request_info(conn);
IpAddress client_addr;

client_addr.set(mg_get_client_address(conn));
Expand Down

0 comments on commit 1a01c4f

Please sign in to comment.