diff --git a/libavutil/frame.c b/libavutil/frame.c
index fe2f40c917d09f00f72211c571e51f1bb5cff4b5..58e77c73f41f5e254f1f9ad1dfe3359d7f4c4a8b 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -310,6 +310,7 @@ void av_frame_unref(AVFrame *frame)
     for (i = 0; i < frame->nb_extended_buf; i++)
         av_buffer_unref(&frame->extended_buf[i]);
     av_freep(&frame->extended_buf);
+    av_dict_free(&frame->metadata);
     get_frame_defaults(frame);
 }