[FFmpeg-devel] [PATCH] fix small memleak in rdt.c

Ronald S. Bultje rsbultje
Sat Nov 15 16:05:05 CET 2008


Hi,

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.

Ronald
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-memleak.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081115/9d151090/attachment.asc>



More information about the ffmpeg-devel mailing list