[pulseaudio-discuss] [PATCH 20/21] object: Initialize allocated memory to zero
Tanu Kaskinen
tanu.kaskinen at linux.intel.com
Wed Jun 19 08:40:17 PDT 2013
This is safer and more convenient for subclasses.
---
src/pulsecore/object.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/pulsecore/object.c b/src/pulsecore/object.c
index 0dc8198..b6fbe90 100644
--- a/src/pulsecore/object.c
+++ b/src/pulsecore/object.c
@@ -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;
--
1.8.1.2
More information about the pulseaudio-discuss
mailing list