[Ffmpeg-devel] [PATCH] Fix leak of AVPacket data in ffserver

Bryan Mayland bmayland
Tue Jan 24 00:56:06 CET 2006


Christian Iversen wrote:
> --- ffserver.c  12 Jan 2006 22:43:14 -0000      1.104
> +++ ffserver.c  23 Jan 2006 22:36:23 -0000
> @@ -2169,6 +2175,7 @@
>                              ret = url_open_dyn_buf(&ctx->pb);
>                          }
>                          if (ret < 0) {
> +                            av_free_packet(&pkt);
>                              /* XXX: potential leak */
>                              return -1;
>                          }
>
> Is that "XXX: potential leak" connected to the fix you just sent here? In that 
> case, I vote for its removal :-)
>   
    It is related yes, but I was hesitant to remove it pending further 
review of the rest of the code in that case (~175 lines of code with 
gotos).  I found it odd that there would be a "potential leak" fixme 
where the only problem was freeing the packet data (considering it is 
handled properly in other break conditions) so I thought I'd leave it 
in.  Then, someone would see it in the patch and say "Hey, we can remove 
that fixme now", I wouldn't have removed a comment I should have left, 
and everyone goes home happy :)





More information about the ffmpeg-devel mailing list