aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimo Wischer <twischer@de.adit-jv.com>2018-07-30 16:04:59 +0200
committerDavid Robillard <d@drobilla.net>2018-08-01 19:10:05 +0200
commit347103e4f0a1e338b0cf3afd31c54cd06e217a99 (patch)
tree1c0a36e8929ef14a51fba98bf4c289345b373971 /src
parentfde74494c925cc5323d201972722aed6f4849506 (diff)
downloadjalv-347103e4f0a1e338b0cf3afd31c54cd06e217a99.tar.gz
jalv-347103e4f0a1e338b0cf3afd31c54cd06e217a99.tar.bz2
jalv-347103e4f0a1e338b0cf3afd31c54cd06e217a99.zip
Make zix_ring_free() safe to call on NULL
Diffstat (limited to 'src')
-rw-r--r--src/zix/ring.c6
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