mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-29 11:08:35 -05:00
object: Initialize allocated memory to zero
This is safer and more convenient for subclasses.
This commit is contained in:
parent
a9c3503ee9
commit
c005ec79f7
1 changed files with 1 additions and 1 deletions
|
|
@ -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(type_id));
|
||||||
pa_assert(check_type(pa_object_type_id));
|
pa_assert(check_type(pa_object_type_id));
|
||||||
|
|
||||||
o = pa_xmalloc(size);
|
o = pa_xmalloc0(size);
|
||||||
PA_REFCNT_INIT(o);
|
PA_REFCNT_INIT(o);
|
||||||
o->type_id = type_id;
|
o->type_id = type_id;
|
||||||
o->free = pa_object_free;
|
o->free = pa_object_free;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue