changeset 125:0ac59c798773

Use th_malloc0() where appropriate.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 22 Jun 2014 03:34:00 +0300
parents 61d882a9758b
children 8efebf863404
files th_config.c th_util.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/th_config.c	Sun Jun 22 02:49:17 2014 +0300
+++ b/th_config.c	Sun Jun 22 03:34:00 2014 +0300
@@ -45,7 +45,7 @@
         return NULL;
 
     /* Allocate new item */
-    node = (th_cfgitem_t *) th_calloc(1, sizeof(th_cfgitem_t));
+    node = (th_cfgitem_t *) th_malloc0(sizeof(th_cfgitem_t));
     if (node == NULL)
         return NULL;
 
--- a/th_util.c	Sun Jun 22 02:49:17 2014 +0300
+++ b/th_util.c	Sun Jun 22 03:34:00 2014 +0300
@@ -216,7 +216,7 @@
  */
 qlist_t * th_llist_new(void *data)
 {
-    qlist_t *res = th_calloc(sizeof(qlist_t), 1);
+    qlist_t *res = th_malloc0(sizeof(qlist_t));
     res->data = data;
     return res;
 }
@@ -506,7 +506,7 @@
  */
 qringbuf_t * th_ringbuf_new(const size_t size, void (*mdeallocator)(void *data))
 {
-    qringbuf_t *res = th_calloc(1, sizeof(qringbuf_t));
+    qringbuf_t *res = th_malloc0(sizeof(qringbuf_t));
     
     res->data = (char **) th_calloc(size, sizeof(char *));
     res->size = size;