Added missing check
This commit is contained in:
+4
-2
@@ -136,8 +136,10 @@ void *ndpi_realloc(void *ptr, size_t old_size, size_t new_size) {
|
||||
if(!ret)
|
||||
return(ret);
|
||||
else {
|
||||
memcpy(ret, ptr, old_size);
|
||||
ndpi_free(ptr);
|
||||
if(ptr != NULL) {
|
||||
memcpy(ret, ptr, old_size);
|
||||
ndpi_free(ptr);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user