From: Andre Noll Date: Fri, 13 Aug 2021 20:00:32 +0000 (+0200) Subject: mp4: Fix memory leak in mp4_meta_update(). X-Git-Tag: v0.7.1~7^2~85 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=c45daa651ab777119735b82fa8ab2c240b025b99;p=paraslash.git mp4: Fix memory leak in mp4_meta_update(). This function calls modify_moov() which allocates and returns a possibly large buffer, but this buffer is never freed. Found by valgrind. --- diff --git a/mp4.c b/mp4.c index f576529c..d2a54eb2 100644 --- a/mp4.c +++ b/mp4.c @@ -1742,6 +1742,7 @@ int32_t mp4_meta_update(const struct mp4_callback *cb, write_data(f, "moov", 4); write_data(f, new_moov_data, new_moov_size); } + free(new_moov_data); cb->truncate(cb->user_data); mp4_close(f); return 1;