From afcf3e154ab8765f49d85e43c76cde5bc8bf5909 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 9 Jan 2017 13:18:11 +0100 Subject: [PATCH] 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. --- stream/cache.c | 4 +--- 1 file changed, 1 insertion(+), 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.