From 0f06855d25893bcba7e797f4b8811379a6f785c1 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Sat, 14 Aug 2021 23:20:15 +0200 Subject: [PATCH] mp4: Merge membuffer_free() into membuffer_transfer_from_file(). The latter is the only caller of the former. --- mp4.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/mp4.c b/mp4.c index e20cf938..03f80ba9 100644 --- a/mp4.c +++ b/mp4.c @@ -1201,12 +1201,6 @@ static void membuffer_write_std_tag(struct membuffer *buf, const char *name, membuffer_write(buf, value, len); } -static void membuffer_free(struct membuffer *buf) -{ - free(buf->data); - free(buf); -} - static unsigned membuffer_get_size(const struct membuffer *buf) { return buf->written; @@ -1281,7 +1275,8 @@ static bool membuffer_transfer_from_file(struct membuffer *buf, struct mp4 *src, membuffer_write(buf, 0, bytes); bufptr = membuffer_get_ptr(buf); if (read_data(src, bufptr + oldsize, bytes) != bytes) { - membuffer_free(buf); + free(buf->data); + free(buf); return false; } return true; -- 2.39.5