1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 23:02:37 +00:00

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.
This commit is contained in:
wm4 2017-01-09 13:18:11 +01:00
parent c4ad2732f9
commit afcf3e154a

View File

@ -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.