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

Stefano Sabatini stefano.sabatini-lala
Mon Jun 2 23:31:43 CEST 2008


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.

Regards.
-- 
FFmpeg = Friendly & Frenzy MultiPurpose ExchanGer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-ffserver-putenv-warn-01.patch
Type: text/x-diff
Size: 624 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080602/1c75596b/attachment.patch>



More information about the ffmpeg-devel mailing list