mirror of https://github.com/mpv-player/mpv
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:
parent
c4ad2732f9
commit
afcf3e154a
|
@ -338,10 +338,8 @@ static int resize_cache(struct priv *s, int64_t size)
|
||||||
buffer_size += s->back_size;
|
buffer_size += s->back_size;
|
||||||
|
|
||||||
unsigned char *buffer = malloc(buffer_size);
|
unsigned char *buffer = malloc(buffer_size);
|
||||||
if (!buffer) {
|
if (!buffer)
|
||||||
free(buffer);
|
|
||||||
return STREAM_ERROR;
|
return STREAM_ERROR;
|
||||||
}
|
|
||||||
|
|
||||||
if (s->buffer) {
|
if (s->buffer) {
|
||||||
// Copy & free the old ringbuffer data.
|
// Copy & free the old ringbuffer data.
|
||||||
|
|
Loading…
Reference in New Issue