aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/ndpi_main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index fc7a5e530..ca557ea31 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -131,6 +131,10 @@ void *ndpi_realloc(void *ptr, size_t old_size, size_t new_size) {
/* ****************************************** */
char *ndpi_strdup(const char *s) {
+ if( s == NULL ){
+ return NULL;
+ }
+
int len = strlen(s);
char *m = ndpi_malloc(len + 1);