diff --git a/libavformat/utils.c b/libavformat/utils.c
index 284d992ab0..89eb759bc9 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2650,6 +2650,7 @@ void avformat_free_context(AVFormatContext *s)
         if (st->attached_pic.data)
             av_free_packet(&st->attached_pic);
         av_dict_free(&st->metadata);
+        av_freep(&st->probe_data.buf);
         av_free(st->index_entries);
         av_free(st->codec->extradata);
         av_free(st->codec->subtitle_header);