From: Simon McVittie Date: Mon, 19 Sep 2011 14:17:26 +0000 (+0100) Subject: Zero-initialize DBusCounter at allocation X-Git-Tag: dbus-1.5.10~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c64bf1887252aa8baee02d6d6d6ee024c4c451f5;p=platform%2Fupstream%2Fdbus.git Zero-initialize DBusCounter at allocation Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46095 Signed-off-by: Simon McVittie Reviewed-by: Guillaume Desmottes --- 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; }