summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOla Bini <ola@olabini.se>2015-09-15 18:44:53 +0200
committerOla Bini <ola@olabini.se>2015-09-15 18:44:53 +0200
commit5b43ecf2b3130781b6020615ba7a5b3ddc5509ce (patch)
treef530ad22008d3fe5b551ed3b08ffd497139b8a4e /src
parentb4950c9334d476049b8b273ad1d8cb15a86f6074 (diff)
downloadtor-5b43ecf2b3130781b6020615ba7a5b3ddc5509ce.tar.gz
tor-5b43ecf2b3130781b6020615ba7a5b3ddc5509ce.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/common/procmon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/common/procmon.c b/src/common/procmon.c
index 2d0f021724..89c9d751e5 100644
--- a/src/common/procmon.c
+++ b/src/common/procmon.c
@@ -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);
}
-