Merge remote-tracking branch 'qatar/master'
[ffmpeg.git] / libavformat / avio.c
index 47b2d51..4141d0b 100644 (file)
@@ -338,8 +338,11 @@ int ffurl_close(URLContext *h)
 #if CONFIG_NETWORK
     ff_network_close();
 #endif
-    if (h->prot->priv_data_size)
+    if (h->prot->priv_data_size) {
+        if (h->prot->priv_data_class)
+            av_opt_free(h->priv_data);
         av_free(h->priv_data);
+    }
     av_free(h);
     return ret;
 }