crypto: Use av_freep instead of av_free
authorEtienne Buira <etienne.buira.lists@free.fr>
Wed, 8 Jun 2011 00:20:53 +0000 (02:20 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 8 Jun 2011 20:41:53 +0000 (23:41 +0300)
This fixes a potential double free.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/crypto.c

index 789a4d1e7638b0ad1c7ba4a7d3def146893e549a..5e7ee1eba35130e4ad57fa956c8bc01d8b5cef78 100644 (file)
@@ -97,8 +97,8 @@ static int crypto_open(URLContext *h, const char *uri, int flags)
 
     return 0;
 err:
-    av_free(c->key);
-    av_free(c->iv);
+    av_freep(&c->key);
+    av_freep(&c->iv);
     return ret;
 }