[FFmpeg-devel] [PATCH] avformat/hls: release mem resource to fix memleak

Aman Gupta ffmpeg at tmm1.net
Sun Dec 31 07:21:41 EET 2017


On Sat, Dec 30, 2017 at 2:14 PM Derek Buitenhuis <derek.buitenhuis at gmail.com>
wrote:

> On 12/30/2017 5:50 PM, Aman Gupta wrote:
> > There is already a check in place to prevent strncmp from being called
> with
> > NULL.
>
> The point before still holds.
>
> Are people really arguing against consistent use of error checking?
> Inconsistent
> standards of error checking are how bugs and security issues happen.


I really don't think it makes any sense in this case, since it is expected
that the av_opt_get will fail on non-http io contexts. It doesn't matter if
the failure is due to AVERROR_OPTION_NOT_FOUND or AVERROR(ENOMEM). The only
thing that matters is whether http_version_opt is set or remains NULL.

Anyway, I don't feel strongly about this. If you think the extra
instructions to store and compare the return value make this code cleaner
or more secure, so be it. I will send a patch with the requested changes.

Aman


>
> - Derek
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>


More information about the ffmpeg-devel mailing list