diff --git a/libavdevice/iec61883.c b/libavdevice/iec61883.c
index b09929eb56e1bcbdc4c25623993ae047819b241e..dcf755392675a5a42181dc71a2ab42a05b79e5f9 100644
--- a/libavdevice/iec61883.c
+++ b/libavdevice/iec61883.c
@@ -463,6 +463,7 @@ static int iec61883_close(AVFormatContext *context)
     } else {
         iec61883_dv_fb_stop(dv->iec61883_dv);
         iec61883_dv_fb_close(dv->iec61883_dv);
+        av_freep(&dv->dv_demux);
     }
     while (dv->queue_first) {
         DVPacket *packet = dv->queue_first;