[FFmpeg-devel] [PATCH 4/4] avformat/sapenc: fix leak in sap_write_header()
Michael Niedermayer
michael at niedermayer.cc
Tue Jun 24 23:57:29 EEST 2025
On Mon, Jun 23, 2025 at 08:54:24PM +0800, ld y wrote:
> Michael Niedermayer <michael at niedermayer.cc> writes:
>
> > this can be factored like:
> >
> > like
> > + ret = 0;
> > fail:
> > + for (i = 0; i < s->nb_streams; i++)
> > + if (contexts[i])
> > + av_free(contexts[i]->url);
> > av_free(contexts);
> > + if (ret < 0)
> > sap_write_close(s);
> >
>
> Yeah this looks much better. I will use it in my v2 patch.
>
> One more question, would it be ok to rename fail label to end label.
> I'm not sure if it's worth the change, though.
ok in a seperate patch
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20250624/aeec828f/attachment.sig>
More information about the ffmpeg-devel
mailing list