[PATCH 20/21] object: Initialize allocated memory to zero

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux