summaryrefslogtreecommitdiff
path: root/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'dependencies')
2 files changed, 2 insertions, 3 deletions
diff --git a/dependencies/nDPIsrvd.h b/dependencies/nDPIsrvd.h
index 3dcb5d24f..01d9d5c8c 100644
--- a/dependencies/nDPIsrvd.h
+++ b/dependencies/nDPIsrvd.h
@@ -479,7 +479,7 @@ static inline int nDPIsrvd_set_read_timeout(struct nDPIsrvd_socket * const sock,
{
struct timeval tv = {.tv_sec = seconds, .tv_usec = micro_seconds};
- if (sock->fd < 0)
+ if (sock == NULL || sock->fd < 0)
{
return 1;
}
@@ -559,7 +559,7 @@ static inline void nDPIsrvd_cleanup_instance(struct nDPIsrvd_socket * const sock
struct nDPIsrvd_thread_data * current_thread_data;
struct nDPIsrvd_thread_data * ttmp;
- if (instance != NULL)
+ if (sock != NULL && instance != NULL)
{
#ifdef ENABLE_MEMORY_PROFILING
nDPIsrvd_memprof_log("Cleaning up instance 0x%x.", instance->alias_source_key);
diff --git a/dependencies/nDPIsrvd.py b/dependencies/nDPIsrvd.py
index bd15a6bde..5c82d13af 100644
--- a/dependencies/nDPIsrvd.py
+++ b/dependencies/nDPIsrvd.py
@@ -182,7 +182,6 @@ class FlowManager:
if alias not in self.instances:
self.instances[alias] = dict()
if source not in self.instances[alias]:
- self.instances[alias][source] = dict()
self.instances[alias][source] = Instance(alias, source)
self.instances[alias][source].setMostRecentFlowTimeFromJSON(json_dict)