diff options
author | Timo Wischer <twischer@de.adit-jv.com> | 2018-07-30 16:04:59 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-08-01 19:10:05 +0200 |
commit | 347103e4f0a1e338b0cf3afd31c54cd06e217a99 (patch) | |
tree | 1c0a36e8929ef14a51fba98bf4c289345b373971 /src | |
parent | fde74494c925cc5323d201972722aed6f4849506 (diff) | |
download | jalv-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.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 |