From f859957a339a5c03ef44c97f2d1f40d59a537b95 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 19 Sep 2011 15:17:26 +0100 Subject: [PATCH 07/10] Zero-initialize DBusCounter at allocation --- dbus/dbus-resources.c | 17 ++--------------- 1 files changed, 2 insertions(+), 15 deletions(-) diff --git a/dbus/dbus-resources.c b/dbus/dbus-resources.c index 42aedf5..80fb55b 100644 --- a/dbus/dbus-resources.c +++ b/dbus/dbus-resources.c @@ -89,25 +89,12 @@ _dbus_counter_new (void) { DBusCounter *counter; - counter = dbus_new (DBusCounter, 1); + counter = dbus_new0 (DBusCounter, 1); if (counter == NULL) return NULL; - - counter->refcount = 1; - counter->size_value = 0; - counter->unix_fd_value = 0; -#ifdef DBUS_ENABLE_STATS - counter->peak_size_value = 0; - counter->peak_unix_fd_value = 0; -#endif + counter->refcount = 1; - counter->notify_size_guard_value = 0; - counter->notify_unix_fd_guard_value = 0; - counter->notify_function = NULL; - counter->notify_data = NULL; - counter->notify_pending = FALSE; - return counter; } -- 1.7.9