]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix procmon_new to correctly use zeroed memory - otherwise it can blow up if the...
authorOla Bini <ola@olabini.se>
Tue, 15 Sep 2015 16:44:53 +0000 (18:44 +0200)
committerOla Bini <ola@olabini.se>
Tue, 15 Sep 2015 16:44:53 +0000 (18:44 +0200)
src/common/procmon.c

index 2d0f021724bdba99ac8301dcaf8bcee8122ad73d..89c9d751e51994a7d7f495dc724d2cfc6c7fce89 100644 (file)
@@ -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);
 }
-