From: Andre Noll Date: Sat, 14 Aug 2021 21:20:15 +0000 (+0200) Subject: mp4: Merge membuffer_free() into membuffer_transfer_from_file(). X-Git-Tag: v0.7.1~7^2~66 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=0f06855d25893bcba7e797f4b8811379a6f785c1;p=paraslash.git mp4: Merge membuffer_free() into membuffer_transfer_from_file(). The latter is the only caller of the former. --- 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;