crypto: Use av_freep instead of av_free

Message ID 1303665244-17326-1-git-send-email-martin@martin.st
State Committed
Commit ac9cf2e5c48aa1edb2c7ba8e7edfa55c9fde609b
Headers show

Commit Message

Martin Storsjö April 24, 2011, 5:14 p.m.
Using av_freep is generally good practice.
---
 libavformat/crypto.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Justin Ruggles April 24, 2011, 5:34 p.m. | #1
On 04/24/2011 01:14 PM, Martin Storsjö wrote:

> Using av_freep is generally good practice.
> ---
>  libavformat/crypto.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavformat/crypto.c b/libavformat/crypto.c
> index ea6012a..fecc2c9 100644
> --- a/libavformat/crypto.c
> +++ b/libavformat/crypto.c
> @@ -153,9 +153,9 @@ static int crypto_close(URLContext *h)
>      CryptoContext *c = h->priv_data;
>      if (c->hd)
>          ffurl_close(c->hd);
> -    av_free(c->aes);
> -    av_free(c->key);
> -    av_free(c->iv);
> +    av_freep(&c->aes);
> +    av_freep(&c->key);
> +    av_freep(&c->iv);
>      return 0;
>  }


looks fine to me.

-Justin

Patch

diff --git a/libavformat/crypto.c b/libavformat/crypto.c
index ea6012a..fecc2c9 100644
--- a/libavformat/crypto.c
+++ b/libavformat/crypto.c
@@ -153,9 +153,9 @@  static int crypto_close(URLContext *h)
     CryptoContext *c = h->priv_data;
     if (c->hd)
         ffurl_close(c->hd);
-    av_free(c->aes);
-    av_free(c->key);
-    av_free(c->iv);
+    av_freep(&c->aes);
+    av_freep(&c->key);
+    av_freep(&c->iv);
     return 0;
 }