summaryrefslogtreecommitdiff
path: root/dependencies/nDPIsrvd.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-08-14 01:15:46 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-10-05 17:37:42 +0200
commit44adfc0b7d1badd0dd9ed83da3a94477e53203a3 (patch)
tree06b2ab4317b29de4667d9891519b3d703560e788 /dependencies/nDPIsrvd.h
parentdfd044930689aa6d2af94d15d1372923c5302ffb (diff)
Sonarcloud integration
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'dependencies/nDPIsrvd.h')
-rw-r--r--dependencies/nDPIsrvd.h4
1 files changed, 2 insertions, 2 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);