avio: Free URLContext private data allocated via AVOptions
authorMartin Storsjö <martin@martin.st>
Tue, 8 Nov 2011 22:48:40 +0000 (00:48 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 10 Nov 2011 08:51:06 +0000 (10:51 +0200)
Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/avio.c

index a954aa8..8e18549 100644 (file)
@@ -335,8 +335,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;
 }