From c45daa651ab777119735b82fa8ab2c240b025b99 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 13 Aug 2021 22:00:32 +0200 Subject: [PATCH] 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. --- mp4.c | 1 + 1 file changed, 1 insertion(+) 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; -- 2.39.5