changeset 25:2f7270a9d593

Make ringbuffer deallocator function call only happen if data pointer is != NULL
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 11 Jun 2011 05:00:23 +0300
parents f7a509f96a5d
children 04187ae0b3b6
files th_util.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/th_util.c	Sat Jun 11 04:59:05 2011 +0300
+++ b/th_util.c	Sat Jun 11 05:00:23 2011 +0300
@@ -422,7 +422,8 @@
     int i;
     
     for (i = 0; i < buf->n; i++)
-        buf->deallocator(buf->data[i]);
+        if (buf->data[i] != NULL)
+            buf->deallocator(buf->data[i]);
     
     th_free(buf->data);
     th_free(buf);