[FFmpeg-devel] [PATCH] Fix ffserver.c putenv gcc warning

Stefano Sabatini stefano.sabatini-lala
Tue Jun 3 00:28:30 CEST 2008


On date Monday 2008-06-02 14:51:53 -0700, Baptiste Coudurier encoded:
> Hi,
> 
> Stefano Sabatini wrote:
> > On date Friday 2008-05-30 17:21:34 +0100, M?ns Rullg?rd encoded:
> >> Stefano Sabatini <stefano.sabatini-lala at poste.it> writes:
> >>
> >>> Hi all,
> >>>
> >>> putenv expects a char* when we feed it with a const char*, this fixes
> >>> the resulting warning:
> >>> ffserver.c: In function ?main?:
> >>> ffserver.c:4388: warning: passing argument 1 of ?putenv? discards qualifiers from pointer target type
> > [...]
> > 
> >>> Index: ffserver.c
> >>> ===================================================================
> >>> --- ffserver.c	(revision 13552)
> >>> +++ ffserver.c	(working copy)
> >>> @@ -4385,7 +4385,7 @@
> >>>  
> >>>      parse_options(argc, argv, options, NULL);
> >>>  
> >>> -    putenv("http_proxy");               /* Kill the http_proxy */
> >>> +    putenv(av_strdup("http_proxy"));    /* Kill the http_proxy */
> >> Beautiful memory leak.
> > 
> > Hi.
> > 
> > Is a string left on the heap really a problem? also the alternative
> > solution (attached) looks quite ugly, also keeping the warning doesn't
> > look like a nice solution.
> > 
> 
> What about using unsetenv ?

Allright ;)

Regards.
-- 
FFmpeg = Foolish & Funny MultiPurpose EntanGlement
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-ffserver-putenv-warn-02.patch
Type: text/x-diff
Size: 428 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080603/7511a1a8/attachment.patch>



More information about the ffmpeg-devel mailing list