avserver.c:3617: error: Memory Leak
  `stream` is not reachable after line 3617, column 14.

avserver.c:3607:1: start of procedure build_file_streams()
3605. 
3606. /* compute the needed AVStream for each file */
3607. static void build_file_streams(void)
      ^
3608. {
3609.     FFStream *stream, *stream_next;

avserver.c:3613:9: 
3611. 
3612.     /* gather all streams */
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
              ^
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;

avserver.c:3613:32: Loop condition is true. Entering loop body
3611. 
3612.     /* gather all streams */
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
                                     ^
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;

avserver.c:3614:9: 
3612.     /* gather all streams */
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3614.         AVFormatContext *infile = NULL;
              ^
3615.         stream_next = stream->next;
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&

avserver.c:3615:9: 
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;
              ^
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3617.             !stream->feed) {

avserver.c:3616:13: Taking true branch
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&
                  ^
3617.             !stream->feed) {
3618.             /* the stream comes from a file */

avserver.c:3617:14: Taking true branch
3615.         stream_next = stream->next;
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3617.             !stream->feed) {
                   ^
3618.             /* the stream comes from a file */
3619.             /* try to open the file */

avserver.c:3621:17: Taking false branch
3619.             /* try to open the file */
3620.             /* open stream */
3621.             if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
                      ^
3622.                 /* specific case : if transport stream output to RTP,
3623.                    we use a raw transport stream reader */

avserver.c:3627:13: 
3625.             }
3626. 
3627.             http_log("Opening file '%s'\n", stream->feed_filename);
                  ^
3628.             if ((ret = avformat_open_input(&infile, stream->feed_filename, stream->ifmt, &stream->in_opts)) < 0) {
3629.                 http_log("Could not open '%s': %d\n", stream->feed_filename, ret);

avserver.c:420:1: start of procedure http_log()
  418. 
  419. #ifdef __GNUC__
  420. __attribute__ ((format (printf, 1, 2)))
       ^
  421. #endif
  422. static void http_log(const char *fmt, ...)

avserver.c:425:5: 
  423. {
  424.     va_list vargs;
  425.     va_start(vargs, fmt);
           ^
  426.     http_vlog(fmt, vargs);
  427.     va_end(vargs);

avserver.c:426:5: 
  424.     va_list vargs;
  425.     va_start(vargs, fmt);
  426.     http_vlog(fmt, vargs);
           ^
  427.     va_end(vargs);
  428. }

avserver.c:404:1: start of procedure http_vlog()
    402. }
    403. 
    404. static void http_vlog(const char *fmt, va_list vargs)
         ^
    405. {
    406.     static int print_prefix = 1;

avserver.c:406:5: 
    404. static void http_vlog(const char *fmt, va_list vargs)
    405. {
    406.     static int print_prefix = 1;
             ^
    407.     if (logfile) {
    408.         if (print_prefix) {

avserver.c:407:9: Taking true branch
    405. {
    406.     static int print_prefix = 1;
    407.     if (logfile) {
                 ^
    408.         if (print_prefix) {
    409.             char buf[32];

avserver.c:408:13: Taking true branch
    406.     static int print_prefix = 1;
    407.     if (logfile) {
    408.         if (print_prefix) {
                     ^
    409.             char buf[32];
    410.             ctime1(buf);

avserver.c:410:13: Skipping ctime1(): empty list of specs
    408.         if (print_prefix) {
    409.             char buf[32];
    410.             ctime1(buf);
                     ^
    411.             fprintf(logfile, "%s ", buf);
    412.         }

avserver.c:411:13: 
    409.             char buf[32];
    410.             ctime1(buf);
    411.             fprintf(logfile, "%s ", buf);
                     ^
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;

avserver.c:413:24: Condition is true
    411.             fprintf(logfile, "%s ", buf);
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;
                                ^
    414.         vfprintf(logfile, fmt, vargs);
    415.         fflush(logfile);

avserver.c:413:9: 
    411.             fprintf(logfile, "%s ", buf);
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;
                 ^
    414.         vfprintf(logfile, fmt, vargs);
    415.         fflush(logfile);

avserver.c:414:9: 
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;
    414.         vfprintf(logfile, fmt, vargs);
                 ^
    415.         fflush(logfile);
    416.     }

avserver.c:415:9: 
    413.         print_prefix = strstr(fmt, "\n") != NULL;
    414.         vfprintf(logfile, fmt, vargs);
    415.         fflush(logfile);
                 ^
    416.     }
    417. }

avserver.c:407:5: 
    405. {
    406.     static int print_prefix = 1;
    407.     if (logfile) {
             ^
    408.         if (print_prefix) {
    409.             char buf[32];

avserver.c:417:1: return from a call to http_vlog
    415.         fflush(logfile);
    416.     }
    417. }
         ^
    418. 
    419. #ifdef __GNUC__

avserver.c:427:5: 
  425.     va_start(vargs, fmt);
  426.     http_vlog(fmt, vargs);
  427.     va_end(vargs);
           ^
  428. }
  429. 

avserver.c:428:1: return from a call to http_log
  426.     http_vlog(fmt, vargs);
  427.     va_end(vargs);
  428. }
       ^
  429. 
  430. static void http_av_log(void *ptr, int level, const char *fmt, va_list vargs)

avserver.c:3628:17: 
3626. 
3627.             http_log("Opening file '%s'\n", stream->feed_filename);
3628.             if ((ret = avformat_open_input(&infile, stream->feed_filename, stream->ifmt, &stream->in_opts)) < 0) {
                      ^
3629.                 http_log("Could not open '%s': %d\n", stream->feed_filename, ret);
3630.                 /* remove stream (no need to spend more time on it) */

libavformat/utils.c:381:1: start of procedure avformat_open_input()
  379. }
  380. 
  381. int avformat_open_input(AVFormatContext **ps, const char *filename,
       ^
  382.                         AVInputFormat *fmt, AVDictionary **options)
  383. {

libavformat/utils.c:384:5: 
  382.                         AVInputFormat *fmt, AVDictionary **options)
  383. {
  384.     AVFormatContext *s = *ps;
           ^
  385.     int ret = 0;
  386.     AVDictionary *tmp = NULL;

libavformat/utils.c:385:5: 
  383. {
  384.     AVFormatContext *s = *ps;
  385.     int ret = 0;
           ^
  386.     AVDictionary *tmp = NULL;
  387.     ID3v2ExtraMeta *id3v2_extra_meta = NULL;

libavformat/utils.c:386:5: 
  384.     AVFormatContext *s = *ps;
  385.     int ret = 0;
  386.     AVDictionary *tmp = NULL;
           ^
  387.     ID3v2ExtraMeta *id3v2_extra_meta = NULL;
  388. 

libavformat/utils.c:387:5: 
  385.     int ret = 0;
  386.     AVDictionary *tmp = NULL;
  387.     ID3v2ExtraMeta *id3v2_extra_meta = NULL;
           ^
  388. 
  389.     if (!s && !(s = avformat_alloc_context()))

libavformat/utils.c:389:10: Taking true branch
  387.     ID3v2ExtraMeta *id3v2_extra_meta = NULL;
  388. 
  389.     if (!s && !(s = avformat_alloc_context()))
                ^
  390.         return AVERROR(ENOMEM);
  391.     if (fmt)

libavformat/utils.c:389:17: Taking true branch
  387.     ID3v2ExtraMeta *id3v2_extra_meta = NULL;
  388. 
  389.     if (!s && !(s = avformat_alloc_context()))
                       ^
  390.         return AVERROR(ENOMEM);
  391.     if (fmt)

libavformat/utils.c:390:9: 
  388. 
  389.     if (!s && !(s = avformat_alloc_context()))
  390.         return AVERROR(ENOMEM);
               ^
  391.     if (fmt)
  392.         s->iformat = fmt;

libavformat/utils.c:464:1: return from a call to avformat_open_input
  462.     *ps = NULL;
  463.     return ret;
  464. }
       ^
  465. 
  466. /*******************************************************/

avserver.c:3628:17: Taking true branch
3626. 
3627.             http_log("Opening file '%s'\n", stream->feed_filename);
3628.             if ((ret = avformat_open_input(&infile, stream->feed_filename, stream->ifmt, &stream->in_opts)) < 0) {
                      ^
3629.                 http_log("Could not open '%s': %d\n", stream->feed_filename, ret);
3630.                 /* remove stream (no need to spend more time on it) */

avserver.c:3629:17: 
3627.             http_log("Opening file '%s'\n", stream->feed_filename);
3628.             if ((ret = avformat_open_input(&infile, stream->feed_filename, stream->ifmt, &stream->in_opts)) < 0) {
3629.                 http_log("Could not open '%s': %d\n", stream->feed_filename, ret);
                      ^
3630.                 /* remove stream (no need to spend more time on it) */
3631.             fail:

avserver.c:420:1: start of procedure http_log()
  418. 
  419. #ifdef __GNUC__
  420. __attribute__ ((format (printf, 1, 2)))
       ^
  421. #endif
  422. static void http_log(const char *fmt, ...)

avserver.c:425:5: 
  423. {
  424.     va_list vargs;
  425.     va_start(vargs, fmt);
           ^
  426.     http_vlog(fmt, vargs);
  427.     va_end(vargs);

avserver.c:426:5: 
  424.     va_list vargs;
  425.     va_start(vargs, fmt);
  426.     http_vlog(fmt, vargs);
           ^
  427.     va_end(vargs);
  428. }

avserver.c:404:1: start of procedure http_vlog()
    402. }
    403. 
    404. static void http_vlog(const char *fmt, va_list vargs)
         ^
    405. {
    406.     static int print_prefix = 1;

avserver.c:406:5: 
    404. static void http_vlog(const char *fmt, va_list vargs)
    405. {
    406.     static int print_prefix = 1;
             ^
    407.     if (logfile) {
    408.         if (print_prefix) {

avserver.c:407:9: Taking true branch
    405. {
    406.     static int print_prefix = 1;
    407.     if (logfile) {
                 ^
    408.         if (print_prefix) {
    409.             char buf[32];

avserver.c:408:13: Taking true branch
    406.     static int print_prefix = 1;
    407.     if (logfile) {
    408.         if (print_prefix) {
                     ^
    409.             char buf[32];
    410.             ctime1(buf);

avserver.c:410:13: Skipping ctime1(): empty list of specs
    408.         if (print_prefix) {
    409.             char buf[32];
    410.             ctime1(buf);
                     ^
    411.             fprintf(logfile, "%s ", buf);
    412.         }

avserver.c:411:13: 
    409.             char buf[32];
    410.             ctime1(buf);
    411.             fprintf(logfile, "%s ", buf);
                     ^
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;

avserver.c:413:24: Condition is true
    411.             fprintf(logfile, "%s ", buf);
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;
                                ^
    414.         vfprintf(logfile, fmt, vargs);
    415.         fflush(logfile);

avserver.c:413:9: 
    411.             fprintf(logfile, "%s ", buf);
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;
                 ^
    414.         vfprintf(logfile, fmt, vargs);
    415.         fflush(logfile);

avserver.c:414:9: 
    412.         }
    413.         print_prefix = strstr(fmt, "\n") != NULL;
    414.         vfprintf(logfile, fmt, vargs);
                 ^
    415.         fflush(logfile);
    416.     }

avserver.c:415:9: 
    413.         print_prefix = strstr(fmt, "\n") != NULL;
    414.         vfprintf(logfile, fmt, vargs);
    415.         fflush(logfile);
                 ^
    416.     }
    417. }

avserver.c:407:5: 
    405. {
    406.     static int print_prefix = 1;
    407.     if (logfile) {
             ^
    408.         if (print_prefix) {
    409.             char buf[32];

avserver.c:417:1: return from a call to http_vlog
    415.         fflush(logfile);
    416.     }
    417. }
         ^
    418. 
    419. #ifdef __GNUC__

avserver.c:427:5: 
  425.     va_start(vargs, fmt);
  426.     http_vlog(fmt, vargs);
  427.     va_end(vargs);
           ^
  428. }
  429. 

avserver.c:428:1: return from a call to http_log
  426.     http_vlog(fmt, vargs);
  427.     va_end(vargs);
  428. }
       ^
  429. 
  430. static void http_av_log(void *ptr, int level, const char *fmt, va_list vargs)

avserver.c:3631:13: 
3629.                 http_log("Could not open '%s': %d\n", stream->feed_filename, ret);
3630.                 /* remove stream (no need to spend more time on it) */
3631.             fail:
                  ^
3632.                 remove_stream(stream);
3633.             } else {

avserver.c:3632:17: Skipping remove_stream(): empty list of specs
3630.                 /* remove stream (no need to spend more time on it) */
3631.             fail:
3632.                 remove_stream(stream);
                      ^
3633.             } else {
3634.                 /* find all the AVStreams inside and reference them in

avserver.c:3613:48: 
3611. 
3612.     /* gather all streams */
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
                                                     ^
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;

avserver.c:3613:32: Loop condition is true. Entering loop body
3611. 
3612.     /* gather all streams */
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
                                     ^
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;

avserver.c:3614:9: 
3612.     /* gather all streams */
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3614.         AVFormatContext *infile = NULL;
              ^
3615.         stream_next = stream->next;
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&

avserver.c:3615:9: 
3613.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;
              ^
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3617.             !stream->feed) {

avserver.c:3616:13: Taking true branch
3614.         AVFormatContext *infile = NULL;
3615.         stream_next = stream->next;
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&
                  ^
3617.             !stream->feed) {
3618.             /* the stream comes from a file */

avserver.c:3617:14: Taking false branch
3615.         stream_next = stream->next;
3616.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3617.             !stream->feed) {
                   ^
3618.             /* the stream comes from a file */
3619.             /* try to open the file */
