summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-09 13:18:11 +0100
committerwm4 <wm4@nowhere>2017-01-09 13:18:11 +0100
commitafcf3e154ab8765f49d85e43c76cde5bc8bf5909 (patch)
treed3351c26314b21fae5ef1dfa10f3a3387fe4fde8 /stream
parentc4ad2732f99bd6dd8e09e284590ac0f3428482a1 (diff)
downloadmpv-afcf3e154ab8765f49d85e43c76cde5bc8bf5909.tar.bz2
mpv-afcf3e154ab8765f49d85e43c76cde5bc8bf5909.tar.xz
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.c4
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.