am 5dbfdc0b
: Add double free protection to checkseapp.
* commit '5dbfdc0b0fec04d670912c4eed179983f98abe8a': Add double free protection to checkseapp.
This commit is contained in:
commit
8f4600c0f8
1 changed files with 6 additions and 0 deletions
|
@ -428,8 +428,11 @@ static void rule_map_free(rule_map *rm, rule_map_switch s) {
|
||||||
free(m->data);
|
free(m->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* hdestroy() frees comparsion keys for non glibc */
|
||||||
|
#ifdef __GLIBC__
|
||||||
if(s == rule_map_destroy_key && rm->key)
|
if(s == rule_map_destroy_key && rm->key)
|
||||||
free(rm->key);
|
free(rm->key);
|
||||||
|
#endif
|
||||||
|
|
||||||
free(rm);
|
free(rm);
|
||||||
}
|
}
|
||||||
|
@ -778,7 +781,10 @@ static void rule_add(rule_map *rm) {
|
||||||
*/
|
*/
|
||||||
preserved_key = tmp->r->key;
|
preserved_key = tmp->r->key;
|
||||||
rule_map_free(tmp->r, rule_map_preserve_key);
|
rule_map_free(tmp->r, rule_map_preserve_key);
|
||||||
|
/* hdestroy() frees comparsion keys for non glibc */
|
||||||
|
#ifdef __GLIBC__
|
||||||
free(rm->key);
|
free(rm->key);
|
||||||
|
#endif
|
||||||
rm->key = preserved_key;
|
rm->key = preserved_key;
|
||||||
tmp->r = rm;
|
tmp->r = rm;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue