Browse code

crypto: Don't manually free memory allocated via AVOptions

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

Martin Storsjö authored on 2011/11/09 07:50:37
Showing 1 changed files
... ...
@@ -61,7 +61,7 @@ static const AVClass crypto_class = {
61 61
 static int crypto_open(URLContext *h, const char *uri, int flags)
62 62
 {
63 63
     const char *nested_url;
64
-    int ret;
64
+    int ret = 0;
65 65
     CryptoContext *c = h->priv_data;
66 66
 
67 67
     if (!av_strstart(uri, "crypto+", &nested_url) &&
... ...
@@ -95,10 +95,7 @@ static int crypto_open(URLContext *h, const char *uri, int flags)
95 95
 
96 96
     h->is_streamed = 1;
97 97
 
98
-    return 0;
99 98
 err:
100
-    av_freep(&c->key);
101
-    av_freep(&c->iv);
102 99
     return ret;
103 100
 }
104 101
 
... ...
@@ -157,8 +154,6 @@ static int crypto_close(URLContext *h)
157 157
     if (c->hd)
158 158
         ffurl_close(c->hd);
159 159
     av_freep(&c->aes);
160
-    av_freep(&c->key);
161
-    av_freep(&c->iv);
162 160
     return 0;
163 161
 }
164 162