mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 01:22:18 +03:00
Code cleanup: Initialize variables and others good practice
- initialize invalid_countin UrlDecode :: evaluate - Free resources before the process die (good practice)
This commit is contained in:
committed by
Felipe Zimmerle
parent
a278bb673a
commit
e4c822e663
@@ -461,8 +461,11 @@ TreeNode *CPTAddElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree
|
||||
} else {
|
||||
i_node = CPTCreateNode();
|
||||
|
||||
if(i_node == NULL)
|
||||
if (i_node == NULL) {
|
||||
free(new_node->prefix);
|
||||
free(new_node);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//i_node->prefix = NULL;
|
||||
i_node->bit = test_bit;
|
||||
@@ -480,6 +483,9 @@ TreeNode *CPTAddElement(unsigned char *ipdata, unsigned int ip_bitmask, CPTTree
|
||||
i_node->netmasks = reinterpret_cast<unsigned char *>(malloc((node->count - i) * sizeof(unsigned char)));
|
||||
|
||||
if(i_node->netmasks == NULL) {
|
||||
free(new_node->prefix);
|
||||
free(new_node);
|
||||
free(i_node);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user