object: Initialize allocated memory to zero

This is safer and more convenient for subclasses.
This commit is contained in:
Tanu Kaskinen 2013-06-19 18:40:17 +03:00
parent a9c3503ee9
commit c005ec79f7

View file

@ -40,7 +40,7 @@ pa_object *pa_object_new_internal(size_t size, const char *type_id, pa_bool_t (*
pa_assert(check_type(type_id));
pa_assert(check_type(pa_object_type_id));
o = pa_xmalloc(size);
o = pa_xmalloc0(size);
PA_REFCNT_INIT(o);
o->type_id = type_id;
o->free = pa_object_free;