Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Martin Storsjö
On Wed, 8 Jun 2011, Etienne Buira wrote: > On Wed, Jun 08, 2011 at 11:37:59PM +0300, Martin Storsjö wrote: > > On Wed, 8 Jun 2011, Etienne Buira wrote: > > > > > On Wed, Jun 08, 2011 at 10:55:03PM +0300, Martin Storsjö wrote: > > > > The original commit that this is a cherry-pick of actually > >

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Etienne Buira
On Wed, Jun 08, 2011 at 11:37:59PM +0300, Martin Storsjö wrote: > On Wed, 8 Jun 2011, Etienne Buira wrote: > > > On Wed, Jun 08, 2011 at 10:55:03PM +0300, Martin Storsjö wrote: > > > The original commit that this is a cherry-pick of actually > > > introduced a memory leak - this only fixes the pot

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free

2011-06-08 Thread Ronald S. Bultje
Hi, On Wed, Jun 8, 2011 at 4:38 PM, Martin Storsjö wrote: > From: Etienne Buira > > This fixes a potential double free. > --- >  libavformat/crypto.c |    4 ++-- >  1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavformat/crypto.c b/libavformat/crypto.c > index 789a4d1..5e7e

[libav-devel] [PATCH] crypto: Use av_freep instead of av_free

2011-06-08 Thread Martin Storsjö
From: Etienne Buira This fixes a potential double free. --- libavformat/crypto.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/crypto.c b/libavformat/crypto.c index 789a4d1..5e7ee1e 100644 --- a/libavformat/crypto.c +++ b/libavformat/crypto.c @@ -97,8 +9

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Martin Storsjö
On Wed, 8 Jun 2011, Etienne Buira wrote: > On Wed, Jun 08, 2011 at 10:55:03PM +0300, Martin Storsjö wrote: > > The original commit that this is a cherry-pick of actually > > introduced a memory leak - this only fixes the potential > > What leak? If I trust libavformat/utils.c:avformat_free_contex

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Martin Storsjö
On Wed, 8 Jun 2011, Ronald S. Bultje wrote: > Hi, > > On Wed, Jun 8, 2011 at 3:55 PM, Martin Storsjö wrote: > > -    av_free(c->key); > > -    av_free(c->iv); > > +    av_freep(c->key); > > +    av_freep(c->iv); > > av_freep(&...)? Oh crap - yes, fixed locally. // Martin__

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Etienne Buira
On Wed, Jun 08, 2011 at 10:55:03PM +0300, Martin Storsjö wrote: > The original commit that this is a cherry-pick of actually > introduced a memory leak - this only fixes the potential What leak? If I trust libavformat/utils.c:avformat_free_context(), av_opt_free() is called so the hunk you removed

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Ronald S. Bultje
Hi, On Wed, Jun 8, 2011 at 3:55 PM, Martin Storsjö wrote: > -    av_free(c->key); > -    av_free(c->iv); > +    av_freep(c->key); > +    av_freep(c->iv); av_freep(&...)? Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Luca Barbato
On 6/8/11 2:55 PM, Martin Storsjö wrote: The potential double free could only occur if close is called after open returned with a failure - I thought we never call close in such cases, but this makes the code safer, and apparently somebody has run into such issues somewhere. Ok. ___

[libav-devel] [PATCH] crypto: Use av_freep instead of av_free.

2011-06-08 Thread Martin Storsjö
From: Etienne Buira This fixes a potential double free. --- The potential double free could only occur if close is called after open returned with a failure - I thought we never call close in such cases, but this makes the code safer, and apparently somebody has run into such issues somewhere. T

Re: [libav-devel] [PATCH] crypto: Use av_freep instead of av_free

2011-04-24 Thread Justin Ruggles
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/libavform

[libav-devel] [PATCH] crypto: Use av_freep instead of av_free

2011-04-24 Thread Martin Storsjö
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 @@ stat