summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-09-19 15:17:26 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-02-21 14:51:18 +0000
commitc64bf1887252aa8baee02d6d6d6ee024c4c451f5 (patch)
tree7865e5c1b6fa6113bfba579262dfc5f9e3846421
parentf02c898cd9ed4b8c38c5e7fa497ab0bd97212982 (diff)
downloaddbus-c64bf1887252aa8baee02d6d6d6ee024c4c451f5.tar.gz
Zero-initialize DBusCounter at allocation
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46095 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
-rw-r--r--dbus/dbus-resources.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/dbus/dbus-resources.c b/dbus/dbus-resources.c
index 42aedf58..80fb55b2 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;
}