[FFmpeg-devel] [PATCH] fix small memleak in rdt.c
Ronald S. Bultje
rsbultje
Sun Nov 16 17:37:46 CET 2008
Hi,
On Sat, Nov 15, 2008 at 10:05 AM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> On Sat, Nov 15, 2008 at 7:01 AM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> On Fri, Nov 14, 2008 at 05:56:02PM -0500, Ronald S. Bultje wrote:
>>> + rdt->rmctx->pb = &pb;
>>> if (ff_rm_read_mdpr_codecdata(rdt->rmctx, st, size) < 0)
>>> return -1;
>>> + rdt->rmctx->pb = NULL;
>>
>> what about the return? this pointer will still point to the local
>> stack in that case, its hard to proof no code will atempt to use this
>> pointer now and in the future ...
>> i simply think this design is a little ugly
>
> With "this", you mean the random assigning of rmctx->pb? I can make
> that stop (e.g. a PayloadContext->pb, and use a pointer to that as
> rmctx->pb), but the data in it is local too, so I'd have to use
> url_resetbuf() instead of this rmctx->pb=NULL. Let me know if you like
> that better.
>
> Patch with the above fixed attached... If you like the above, I'll do
> that in a patch afterwards since it's a different functional change so
> I'm sure you'd want it in a separate patch anyway.
Since we're very actively reviewing, is it OK if I ping this one
already? Speed is good. :).
Thanks,
Ronald
More information about the ffmpeg-devel
mailing list