diff options
-rw-r--r-- | src/zix/ring.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 |