[tor-commits] [tor/master] Fix bad allocation in pubsub.c

nickm at torproject.org nickm at torproject.org
Thu May 12 14:00:45 UTC 2016


commit 99c0e1bd5b3974c8bf767487e7cf9a9193a3c91a
Author: Nick Mathewson <nickm at torproject.org>
Date:   Thu May 12 09:56:42 2016 -0400

    Fix bad allocation in pubsub.c
    
    Closes 19038.  Bug not in any released Tor.
---
 src/common/pubsub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/common/pubsub.c b/src/common/pubsub.c
index 98ec3f8..b3faf40 100644
--- a/src/common/pubsub.c
+++ b/src/common/pubsub.c
@@ -48,7 +48,7 @@ pubsub_subscribe_(pubsub_topic_t *topic,
   if (subscribe_flags & SUBSCRIBE_ATSTART) {
     tor_assert(topic->n_events_fired == 0);
   }
-  pubsub_subscriber_t *r = tor_malloc_zero(sizeof(r));
+  pubsub_subscriber_t *r = tor_malloc_zero(sizeof(*r));
   r->priority = priority;
   r->subscriber_flags = subscribe_flags;
   r->fn = fn;



More information about the tor-commits mailing list