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

ffserver.c:3296:1: start of procedure build_file_streams()
3294. 
3295. /* compute the needed AVStream for each file */
3296. static void build_file_streams(void)
      ^
3297. {
3298.     FFStream *stream, *stream_next;

ffserver.c:3303:9: 
3301. 
3302.     /* gather all streams */
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
              ^
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&

ffserver.c:3303:32: Loop condition is true. Entering loop body
3301. 
3302.     /* gather all streams */
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
                                     ^
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&

ffserver.c:3304:9: 
3302.     /* gather all streams */
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3304.         stream_next = stream->next;
              ^
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3306.             !stream->feed) {

ffserver.c:3305:13: Taking true branch
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&
                  ^
3306.             !stream->feed) {
3307.             /* the stream comes from a file */

ffserver.c:3306:14: Taking true branch
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3306.             !stream->feed) {
                   ^
3307.             /* the stream comes from a file */
3308.             /* try to open the file */

ffserver.c:3310:13: 
3308.             /* try to open the file */
3309.             /* open stream */
3310.             stream->ap_in = av_mallocz(sizeof(AVFormatParameters));
                  ^
3311.             if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
3312.                 /* specific case : if transport stream output to RTP,

libavutil/mem.c:132:1: start of procedure av_mallocz()
  130. }
  131. 
  132. void *av_mallocz(unsigned int size)
       ^
  133. {
  134.     void *ptr = av_malloc(size);

libavutil/mem.c:134:5: 
  132. void *av_mallocz(unsigned int size)
  133. {
  134.     void *ptr = av_malloc(size);
           ^
  135.     if (ptr)
  136.         memset(ptr, 0, size);

libavutil/mem.c:42:1: start of procedure av_malloc()
    40.    linker will do it automatically */
    41. 
    42. void *av_malloc(unsigned int size)
        ^
    43. {
    44.     void *ptr;

libavutil/mem.c:50:8: Taking false branch
    48. 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
               ^
    51.         return NULL;
    52. 

libavutil/mem.c:61:5: Skipping memalign(): method has no implementation
    59.     ((char*)ptr)[-1]= diff;
    60. #elif defined (HAVE_MEMALIGN)
    61.     ptr = memalign(16,size);
            ^
    62.     /* Why 64?
    63.        Indeed, we should align it:

libavutil/mem.c:91:5: 
    89.     ptr = malloc(size);
    90. #endif
    91.     return ptr;
            ^
    92. }
    93. 

libavutil/mem.c:92:1: return from a call to av_malloc
    90. #endif
    91.     return ptr;
    92. }
        ^
    93. 
    94. void *av_realloc(void *ptr, unsigned int size)

libavutil/mem.c:135:9: Taking false branch
  133. {
  134.     void *ptr = av_malloc(size);
  135.     if (ptr)
               ^
  136.         memset(ptr, 0, size);
  137.     return ptr;

libavutil/mem.c:137:5: 
  135.     if (ptr)
  136.         memset(ptr, 0, size);
  137.     return ptr;
           ^
  138. }
  139. 

libavutil/mem.c:138:1: return from a call to av_mallocz
  136.         memset(ptr, 0, size);
  137.     return ptr;
  138. }
       ^
  139. 
  140. char *av_strdup(const char *s)

ffserver.c:3311:17: Taking true branch
3309.             /* open stream */
3310.             stream->ap_in = av_mallocz(sizeof(AVFormatParameters));
3311.             if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
                      ^
3312.                 /* specific case : if transport stream output to RTP,
3313.                    we use a raw transport stream reader */

ffserver.c:3311:33: Taking false branch
3309.             /* open stream */
3310.             stream->ap_in = av_mallocz(sizeof(AVFormatParameters));
3311.             if (stream->fmt && !strcmp(stream->fmt->name, "rtp")) {
                                      ^
3312.                 /* specific case : if transport stream output to RTP,
3313.                    we use a raw transport stream reader */

ffserver.c:3318:17: 
3316.             }
3317. 
3318.             if (av_open_input_file(&infile, stream->feed_filename,
                      ^
3319.                                    stream->ifmt, 0, stream->ap_in) < 0) {
3320.                 http_log("%s not found", stream->feed_filename);

libavformat/utils.c:416:1: start of procedure av_open_input_file()
  414. #define PROBE_BUF_MAX (1<<20)
  415. 
  416. int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
       ^
  417.                        AVInputFormat *fmt,
  418.                        int buf_size,

libavformat/utils.c:422:5: 
  420. {
  421.     int err, probe_size;
  422.     AVProbeData probe_data, *pd = &probe_data;
           ^
  423.     ByteIOContext *pb = NULL;
  424. 

libavformat/utils.c:423:5: 
  421.     int err, probe_size;
  422.     AVProbeData probe_data, *pd = &probe_data;
  423.     ByteIOContext *pb = NULL;
           ^
  424. 
  425.     pd->filename = "";

libavformat/utils.c:425:5: 
  423.     ByteIOContext *pb = NULL;
  424. 
  425.     pd->filename = "";
           ^
  426.     if (filename)
  427.         pd->filename = filename;

libavformat/utils.c:426:9: Taking true branch
  424. 
  425.     pd->filename = "";
  426.     if (filename)
               ^
  427.         pd->filename = filename;
  428.     pd->buf = NULL;

libavformat/utils.c:427:9: 
  425.     pd->filename = "";
  426.     if (filename)
  427.         pd->filename = filename;
               ^
  428.     pd->buf = NULL;
  429.     pd->buf_size = 0;

libavformat/utils.c:428:5: 
  426.     if (filename)
  427.         pd->filename = filename;
  428.     pd->buf = NULL;
           ^
  429.     pd->buf_size = 0;
  430. 

libavformat/utils.c:429:5: 
  427.         pd->filename = filename;
  428.     pd->buf = NULL;
  429.     pd->buf_size = 0;
           ^
  430. 
  431.     if (!fmt) {

libavformat/utils.c:431:10: Taking false branch
  429.     pd->buf_size = 0;
  430. 
  431.     if (!fmt) {
                ^
  432.         /* guess format if no file can be opened */
  433.         fmt = av_probe_input_format(pd, 0);

libavformat/utils.c:438:10: Taking false branch
  436.     /* Do not open file if the format does not need it. XXX: specific
  437.        hack needed to handle RTSP/TCP */
  438.     if (!fmt || !(fmt->flags & AVFMT_NOFILE)) {
                ^
  439.         /* if no file needed do not try to open one */
  440.         if ((err=url_fopen(&pb, filename, URL_RDONLY)) < 0) {

libavformat/utils.c:438:19: Taking true branch
  436.     /* Do not open file if the format does not need it. XXX: specific
  437.        hack needed to handle RTSP/TCP */
  438.     if (!fmt || !(fmt->flags & AVFMT_NOFILE)) {
                         ^
  439.         /* if no file needed do not try to open one */
  440.         if ((err=url_fopen(&pb, filename, URL_RDONLY)) < 0) {

libavformat/utils.c:440:13: 
  438.     if (!fmt || !(fmt->flags & AVFMT_NOFILE)) {
  439.         /* if no file needed do not try to open one */
  440.         if ((err=url_fopen(&pb, filename, URL_RDONLY)) < 0) {
                   ^
  441.             goto fail;
  442.         }

libavformat/aviobuf.c:585:1: start of procedure url_fopen()
    583. }
    584. 
    585. int url_fopen(ByteIOContext **s, const char *filename, int flags)
         ^
    586. {
    587.     URLContext *h;

libavformat/aviobuf.c:590:5: Skipping url_open(): empty list of specs
    588.     int err;
    589. 
    590.     err = url_open(&h, filename, flags);
             ^
    591.     if (err < 0)
    592.         return err;

libavformat/aviobuf.c:591:9: Taking true branch
    589. 
    590.     err = url_open(&h, filename, flags);
    591.     if (err < 0)
                 ^
    592.         return err;
    593.     err = url_fdopen(s, h);

libavformat/aviobuf.c:592:9: 
    590.     err = url_open(&h, filename, flags);
    591.     if (err < 0)
    592.         return err;
                 ^
    593.     err = url_fdopen(s, h);
    594.     if (err < 0) {

libavformat/aviobuf.c:599:1: return from a call to url_fopen
    597.     }
    598.     return 0;
    599. }
         ^
    600. 
    601. int url_fclose(ByteIOContext *s)

libavformat/utils.c:440:13: Taking true branch
  438.     if (!fmt || !(fmt->flags & AVFMT_NOFILE)) {
  439.         /* if no file needed do not try to open one */
  440.         if ((err=url_fopen(&pb, filename, URL_RDONLY)) < 0) {
                   ^
  441.             goto fail;
  442.         }

libavformat/utils.c:484:2: 
  482.         goto fail;
  483.     return 0;
  484.  fail:
        ^
  485.     av_freep(&pd->buf);
  486.     if (pb)

libavformat/utils.c:485:5: 
  483.     return 0;
  484.  fail:
  485.     av_freep(&pd->buf);
           ^
  486.     if (pb)
  487.         url_fclose(pb);

libavutil/mem.c:125:1: start of procedure av_freep()
    123. }
    124. 
    125. void av_freep(void *arg)
         ^
    126. {
    127.     void **ptr= (void**)arg;

libavutil/mem.c:127:5: 
    125. void av_freep(void *arg)
    126. {
    127.     void **ptr= (void**)arg;
             ^
    128.     av_free(*ptr);
    129.     *ptr = NULL;

libavutil/mem.c:128:5: 
    126. {
    127.     void **ptr= (void**)arg;
    128.     av_free(*ptr);
             ^
    129.     *ptr = NULL;
    130. }

libavutil/mem.c:114:1: start of procedure av_free()
      112. }
      113. 
      114. void av_free(void *ptr)
           ^
      115. {
      116.     /* XXX: this test should not be needed on most libcs */

libavutil/mem.c:117:9: Taking false branch
      115. {
      116.     /* XXX: this test should not be needed on most libcs */
      117.     if (ptr)
                   ^
      118. #ifdef CONFIG_MEMALIGN_HACK
      119.         free((char*)ptr - ((char*)ptr)[-1]);

libavutil/mem.c:117:5: 
      115. {
      116.     /* XXX: this test should not be needed on most libcs */
      117.     if (ptr)
               ^
      118. #ifdef CONFIG_MEMALIGN_HACK
      119.         free((char*)ptr - ((char*)ptr)[-1]);

libavutil/mem.c:123:1: return from a call to av_free
      121.         free(ptr);
      122. #endif
      123. }
           ^
      124. 
      125. void av_freep(void *arg)

libavutil/mem.c:129:5: 
    127.     void **ptr= (void**)arg;
    128.     av_free(*ptr);
    129.     *ptr = NULL;
             ^
    130. }
    131. 

libavutil/mem.c:130:1: return from a call to av_freep
    128.     av_free(*ptr);
    129.     *ptr = NULL;
    130. }
         ^
    131. 
    132. void *av_mallocz(unsigned int size)

libavformat/utils.c:486:9: Taking false branch
  484.  fail:
  485.     av_freep(&pd->buf);
  486.     if (pb)
               ^
  487.         url_fclose(pb);
  488.     *ic_ptr = NULL;

libavformat/utils.c:488:5: 
  486.     if (pb)
  487.         url_fclose(pb);
  488.     *ic_ptr = NULL;
           ^
  489.     return err;
  490. 

libavformat/utils.c:489:5: 
  487.         url_fclose(pb);
  488.     *ic_ptr = NULL;
  489.     return err;
           ^
  490. 
  491. }

libavformat/utils.c:491:1: return from a call to av_open_input_file
  489.     return err;
  490. 
  491. }
       ^
  492. 
  493. /*******************************************************/

ffserver.c:3318:17: Taking true branch
3316.             }
3317. 
3318.             if (av_open_input_file(&infile, stream->feed_filename,
                      ^
3319.                                    stream->ifmt, 0, stream->ap_in) < 0) {
3320.                 http_log("%s not found", stream->feed_filename);

ffserver.c:3320:17: 
3318.             if (av_open_input_file(&infile, stream->feed_filename,
3319.                                    stream->ifmt, 0, stream->ap_in) < 0) {
3320.                 http_log("%s not found", stream->feed_filename);
                      ^
3321.                 /* remove stream (no need to spend more time on it) */
3322.             fail:

ffserver.c:308:1: start of procedure http_log()
  306. static FILE *logfile = NULL;
  307. 
  308. static void __attribute__ ((format (printf, 1, 2))) http_log(const char *fmt, ...)
       ^
  309. {
  310.     va_list ap;

ffserver.c:311:5: 
  309. {
  310.     va_list ap;
  311.     va_start(ap, fmt);
           ^
  312. 
  313.     if (logfile) {

ffserver.c:313:9: Taking true branch
  311.     va_start(ap, fmt);
  312. 
  313.     if (logfile) {
               ^
  314.         vfprintf(logfile, fmt, ap);
  315.         fflush(logfile);

ffserver.c:314:9: 
  312. 
  313.     if (logfile) {
  314.         vfprintf(logfile, fmt, ap);
               ^
  315.         fflush(logfile);
  316.     }

ffserver.c:315:9: 
  313.     if (logfile) {
  314.         vfprintf(logfile, fmt, ap);
  315.         fflush(logfile);
               ^
  316.     }
  317.     va_end(ap);

ffserver.c:317:5: 
  315.         fflush(logfile);
  316.     }
  317.     va_end(ap);
           ^
  318. }
  319. 

ffserver.c:318:1: return from a call to http_log
  316.     }
  317.     va_end(ap);
  318. }
       ^
  319. 
  320. static char *ctime1(char *buf2)

ffserver.c:3322:13: 
3320.                 http_log("%s not found", stream->feed_filename);
3321.                 /* remove stream (no need to spend more time on it) */
3322.             fail:
                  ^
3323.                 remove_stream(stream);
3324.             } else {

ffserver.c:3323:17: Skipping remove_stream(): empty list of specs
3321.                 /* remove stream (no need to spend more time on it) */
3322.             fail:
3323.                 remove_stream(stream);
                      ^
3324.             } else {
3325.                 /* find all the AVStreams inside and reference them in

ffserver.c:3303:48: 
3301. 
3302.     /* gather all streams */
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
                                                     ^
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&

ffserver.c:3303:32: Loop condition is true. Entering loop body
3301. 
3302.     /* gather all streams */
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
                                     ^
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&

ffserver.c:3304:9: 
3302.     /* gather all streams */
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3304.         stream_next = stream->next;
              ^
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3306.             !stream->feed) {

ffserver.c:3305:13: Taking true branch
3303.     for(stream = first_stream; stream != NULL; stream = stream_next) {
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&
                  ^
3306.             !stream->feed) {
3307.             /* the stream comes from a file */

ffserver.c:3306:14: Taking false branch
3304.         stream_next = stream->next;
3305.         if (stream->stream_type == STREAM_TYPE_LIVE &&
3306.             !stream->feed) {
                   ^
3307.             /* the stream comes from a file */
3308.             /* try to open the file */
