From 347103e4f0a1e338b0cf3afd31c54cd06e217a99 Mon Sep 17 00:00:00 2001 From: Timo Wischer Date: Mon, 30 Jul 2018 16:04:59 +0200 Subject: Make zix_ring_free() safe to call on NULL --- src/zix/ring.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/zix/ring.c b/src/zix/ring.c index c5b41f5..a76b4ea 100644 --- a/src/zix/ring.c +++ b/src/zix/ring.c @@ -89,8 +89,10 @@ zix_ring_new(uint32_t size) void zix_ring_free(ZixRing* ring) { - free(ring->buf); - free(ring); + if (ring) { + free(ring->buf); + free(ring); + } } void -- cgit v1.2.1