diff options
author | wm4 <wm4@nowhere> | 2017-01-09 13:18:11 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-01-09 13:18:11 +0100 |
commit | afcf3e154ab8765f49d85e43c76cde5bc8bf5909 (patch) | |
tree | d3351c26314b21fae5ef1dfa10f3a3387fe4fde8 /stream | |
parent | c4ad2732f99bd6dd8e09e284590ac0f3428482a1 (diff) |
cache: remove redundant free()
This code used to check/free multiple things, so the argument to free()
was not always NULL. After the code was simplified, the free() became
redundant.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/cache.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/stream/cache.c b/stream/cache.c index 85b78f9038..b2ff1a91c8 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -338,10 +338,8 @@ static int resize_cache(struct priv *s, int64_t size) buffer_size += s->back_size; unsigned char *buffer = malloc(buffer_size); - if (!buffer) { - free(buffer); + if (!buffer) return STREAM_ERROR; - } if (s->buffer) { // Copy & free the old ringbuffer data. |