Browse code

avio: Free URLContext private data allocated via AVOptions

Signed-off-by: Martin Storsjö <martin@martin.st>

Martin Storsjö authored on 2011/11/09 07:48:40
Showing 1 changed files
... ...
@@ -335,8 +335,11 @@ int ffurl_close(URLContext *h)
335 335
 #if CONFIG_NETWORK
336 336
     ff_network_close();
337 337
 #endif
338
-    if (h->prot->priv_data_size)
338
+    if (h->prot->priv_data_size) {
339
+        if (h->prot->priv_data_class)
340
+            av_opt_free(h->priv_data);
339 341
         av_free(h->priv_data);
342
+    }
340 343
     av_free(h);
341 344
     return ret;
342 345
 }