[FFmpeg-devel] [PATCH] libavformat/ftp: Do not leak memory in routine ftp_features
Alexander Strasser
eclipse7 at gmx.net
Thu Aug 21 23:09:35 CEST 2014
On 2014-08-20 06:27 +0200, Alexander Strasser wrote:
> On 2014-08-20 01:25 +0200, Alexander Strasser wrote:
> > Should fix CID1231988 (RESOURCE_LEAK)
> >
> > Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
> > ---
> >
> > WARNING: Sorry, I only compile-tested so far.
> >
> > There is one remaining thing, I am not sure of:
> > It looks like the variable feet could be uninitialized
> > at the point av_freep is called. I think it cannot, but
> > I had to follow quite some hops down the call hierarchy.
> >
> > I see two possibilities for taking care of that:
> >
> > 1) explicitly initialize it with NULL (could be merged with declaration)
> > 2) someone else goes all the way down and if he comes to the same conclusion
> > as I did, we add a comment stating that to ftp_send_command
>
> After sleeping over it I think I am wrong about 2 because
> ftp_send_command may early return and in those cases leave feat
> uninitialized.
>
> So here is some more:
>
> 3) Examine all places ftp_send_command, ftp_status is called
> and do what described for this instance in point 1
> 4) Change ftp_send_command and ftp_status to make sure the
> out parameter is always valid or at least NULL after a call
>
> Doing 4 seem best to me ATM but maybe I missed some things again :(
Dropped.
I sent v2 which combines points 1, 3 and 4.
https://ffmpeg.org/pipermail/ffmpeg-devel/2014-August/161668.html
Subject: [FFmpeg-devel] [PATCH v2] libavformat/ftp: Do not leak memory in routine ftp_features
Message-ID: <a0e0e8e0008bfc3e7c957ebf3e4d97d89483beba.1408637365.git.eclipse7 at gmx.net>
Alexander
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140821/29c64a31/attachment.asc>
More information about the ffmpeg-devel
mailing list