mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Fix procmon_new to correctly use zeroed memory - otherwise it can blow up if the free call by mistake works on something that is allocated
This commit is contained in:
parent
b4950c9334
commit
5b43ecf2b3
@ -192,7 +192,7 @@ tor_process_monitor_new(struct event_base *base,
|
||||
tor_procmon_callback_t cb, void *cb_arg,
|
||||
const char **msg)
|
||||
{
|
||||
tor_process_monitor_t *procmon = tor_malloc(sizeof(tor_process_monitor_t));
|
||||
tor_process_monitor_t *procmon = tor_malloc_zero(sizeof(tor_process_monitor_t));
|
||||
struct parsed_process_specifier_t ppspec;
|
||||
|
||||
tor_assert(msg != NULL);
|
||||
@ -354,4 +354,3 @@ tor_process_monitor_free(tor_process_monitor_t *procmon)
|
||||
|
||||
tor_free(procmon);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user