libavformat/rtmpproto.c:1861: error: Memory Leak
  memory dynamically allocated to `spkt.data` by call to `ff_rtmp_packet_create()` at line 1845, column 16 is not reachable after line 1861, column 1.

libavformat/rtmpproto.c:1837:1: start of procedure write_begin()
1835. }
1836. 
1837. static int write_begin(URLContext *s)
      ^
1838. {
1839.     RTMPContext *rt = s->priv_data;

libavformat/rtmpproto.c:1839:5: 
1837. static int write_begin(URLContext *s)
1838. {
1839.     RTMPContext *rt = s->priv_data;
          ^
1840.     PutByteContext pbc;
1841.     RTMPPacket spkt = { 0 };

libavformat/rtmpproto.c:1841:5: 
1839.     RTMPContext *rt = s->priv_data;
1840.     PutByteContext pbc;
1841.     RTMPPacket spkt = { 0 };
          ^
1842.     int ret;
1843. 

libavformat/rtmpproto.c:1845:9: 
1843. 
1844.     // Send Stream Begin 1
1845.     if ((ret = ff_rtmp_packet_create(&spkt, RTMP_NETWORK_CHANNEL,
              ^
1846.                                      RTMP_PT_PING, 0, 6)) < 0) {
1847.         av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");

libavformat/rtmppkt.c:401:1: start of procedure ff_rtmp_packet_create()
  399. }
  400. 
  401. int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type,
       ^
  402.                           int timestamp, int size)
  403. {

libavformat/rtmppkt.c:404:9: Taking true branch
  402.                           int timestamp, int size)
  403. {
  404.     if (size) {
               ^
  405.         pkt->data = av_realloc(NULL, size);
  406.         if (!pkt->data)

libavformat/rtmppkt.c:405:9: 
  403. {
  404.     if (size) {
  405.         pkt->data = av_realloc(NULL, size);
               ^
  406.         if (!pkt->data)
  407.             return AVERROR(ENOMEM);

libavutil/mem.c:117:1: start of procedure av_realloc()
    115. }
    116. 
    117. void *av_realloc(void *ptr, size_t size)
         ^
    118. {
    119. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:124:9: Taking false branch
    122. 
    123.     /* let's disallow possibly ambiguous cases */
    124.     if (size > (INT_MAX - 16))
                 ^
    125.         return NULL;
    126. 

libavutil/mem.c:136:5: 
    134.     return _aligned_realloc(ptr, size, 32);
    135. #else
    136.     return realloc(ptr, size);
             ^
    137. #endif
    138. }

libavutil/mem.c:138:1: return from a call to av_realloc
    136.     return realloc(ptr, size);
    137. #endif
    138. }
         ^
    139. 
    140. int av_reallocp(void *ptr, size_t size)

libavformat/rtmppkt.c:406:14: Taking false branch
  404.     if (size) {
  405.         pkt->data = av_realloc(NULL, size);
  406.         if (!pkt->data)
                    ^
  407.             return AVERROR(ENOMEM);
  408.     }

libavformat/rtmppkt.c:409:5: 
  407.             return AVERROR(ENOMEM);
  408.     }
  409.     pkt->size       = size;
           ^
  410.     pkt->channel_id = channel_id;
  411.     pkt->type       = type;

libavformat/rtmppkt.c:410:5: 
  408.     }
  409.     pkt->size       = size;
  410.     pkt->channel_id = channel_id;
           ^
  411.     pkt->type       = type;
  412.     pkt->timestamp  = timestamp;

libavformat/rtmppkt.c:411:5: 
  409.     pkt->size       = size;
  410.     pkt->channel_id = channel_id;
  411.     pkt->type       = type;
           ^
  412.     pkt->timestamp  = timestamp;
  413.     pkt->extra      = 0;

libavformat/rtmppkt.c:412:5: 
  410.     pkt->channel_id = channel_id;
  411.     pkt->type       = type;
  412.     pkt->timestamp  = timestamp;
           ^
  413.     pkt->extra      = 0;
  414.     pkt->ts_field   = 0;

libavformat/rtmppkt.c:413:5: 
  411.     pkt->type       = type;
  412.     pkt->timestamp  = timestamp;
  413.     pkt->extra      = 0;
           ^
  414.     pkt->ts_field   = 0;
  415. 

libavformat/rtmppkt.c:414:5: 
  412.     pkt->timestamp  = timestamp;
  413.     pkt->extra      = 0;
  414.     pkt->ts_field   = 0;
           ^
  415. 
  416.     return 0;

libavformat/rtmppkt.c:416:5: 
  414.     pkt->ts_field   = 0;
  415. 
  416.     return 0;
           ^
  417. }
  418. 

libavformat/rtmppkt.c:417:1: return from a call to ff_rtmp_packet_create
  415. 
  416.     return 0;
  417. }
       ^
  418. 
  419. void ff_rtmp_packet_destroy(RTMPPacket *pkt)

libavformat/rtmpproto.c:1845:9: Taking false branch
1843. 
1844.     // Send Stream Begin 1
1845.     if ((ret = ff_rtmp_packet_create(&spkt, RTMP_NETWORK_CHANNEL,
              ^
1846.                                      RTMP_PT_PING, 0, 6)) < 0) {
1847.         av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");

libavformat/rtmpproto.c:1851:5: 
1849.     }
1850. 
1851.     bytestream2_init_writer(&pbc, spkt.data, spkt.size);
          ^
1852.     bytestream2_put_be16(&pbc, 0);          // 0 -> Stream Begin
1853.     bytestream2_put_be32(&pbc, rt->nb_streamid);

libavcodec/bytestream.h:139:1: start of procedure bytestream2_init_writer()
  137. }
  138. 
  139. static av_always_inline void bytestream2_init_writer(PutByteContext *p,
       ^
  140.                                                      uint8_t *buf,
  141.                                                      int buf_size)

libavcodec/bytestream.h:143:5: 
  141.                                                      int buf_size)
  142. {
  143.     p->buffer       = buf;
           ^
  144.     p->buffer_start = buf;
  145.     p->buffer_end   = buf + buf_size;

libavcodec/bytestream.h:144:5: 
  142. {
  143.     p->buffer       = buf;
  144.     p->buffer_start = buf;
           ^
  145.     p->buffer_end   = buf + buf_size;
  146.     p->eof          = 0;

libavcodec/bytestream.h:145:5: 
  143.     p->buffer       = buf;
  144.     p->buffer_start = buf;
  145.     p->buffer_end   = buf + buf_size;
           ^
  146.     p->eof          = 0;
  147. }

libavcodec/bytestream.h:146:5: 
  144.     p->buffer_start = buf;
  145.     p->buffer_end   = buf + buf_size;
  146.     p->eof          = 0;
           ^
  147. }
  148. 

libavcodec/bytestream.h:147:1: return from a call to bytestream2_init_writer
  145.     p->buffer_end   = buf + buf_size;
  146.     p->eof          = 0;
  147. }
       ^
  148. 
  149. static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)

libavformat/rtmpproto.c:1852:5: 
1850. 
1851.     bytestream2_init_writer(&pbc, spkt.data, spkt.size);
1852.     bytestream2_put_be16(&pbc, 0);          // 0 -> Stream Begin
          ^
1853.     bytestream2_put_be32(&pbc, rt->nb_streamid);
1854. 

libavcodec/bytestream.h:91:1: start of procedure bytestream2_put_be16()
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
      ^
  92. DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
  93. 

libavcodec/bytestream.h:91:1: Taking true branch
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
      ^
  92. DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
  93. 

libavcodec/bytestream.h:91:1: Taking true branch
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
      ^
  92. DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
  93. 

libavutil/ppc/intreadwrite.h:68:1: start of procedure av_write_bswap16()
    66. }
    67. 
    68. static av_always_inline void av_write_bswap16(void *p, uint16_t v)
        ^
    69. {
    70.     __asm__ ("sthbrx  %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));

libavutil/ppc/intreadwrite.h:70:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
    68. static av_always_inline void av_write_bswap16(void *p, uint16_t v)
    69. {
    70.     __asm__ ("sthbrx  %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));
            ^
    71. }
    72. 

libavutil/ppc/intreadwrite.h:71:1: return from a call to av_write_bswap16
    69. {
    70.     __asm__ ("sthbrx  %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));
    71. }
        ^
    72. 
    73. static av_always_inline uint32_t av_read_bswap32(const void *p)

libavcodec/bytestream.h:91:1: return from a call to bytestream2_put_be16
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)
      ^
  92. DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8)
  93. 

libavformat/rtmpproto.c:1853:5: 
1851.     bytestream2_init_writer(&pbc, spkt.data, spkt.size);
1852.     bytestream2_put_be16(&pbc, 0);          // 0 -> Stream Begin
1853.     bytestream2_put_be32(&pbc, rt->nb_streamid);
          ^
1854. 
1855.     ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,

libavcodec/bytestream.h:89:1: start of procedure bytestream2_put_be32()
  87. DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
  88. DEF(uint64_t,     be64, 8, AV_RB64, AV_WB64)
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
      ^
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)

libavcodec/bytestream.h:89:1: Taking true branch
  87. DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
  88. DEF(uint64_t,     be64, 8, AV_RB64, AV_WB64)
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
      ^
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)

libavcodec/bytestream.h:89:1: Taking true branch
  87. DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
  88. DEF(uint64_t,     be64, 8, AV_RB64, AV_WB64)
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
      ^
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)

libavutil/ppc/intreadwrite.h:80:1: start of procedure av_write_bswap32()
    78. }
    79. 
    80. static av_always_inline void av_write_bswap32(void *p, uint32_t v)
        ^
    81. {
    82.     __asm__ ("stwbrx  %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));

libavutil/ppc/intreadwrite.h:82:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
    80. static av_always_inline void av_write_bswap32(void *p, uint32_t v)
    81. {
    82.     __asm__ ("stwbrx  %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));
            ^
    83. }
    84. 

libavutil/ppc/intreadwrite.h:83:1: return from a call to av_write_bswap32
    81. {
    82.     __asm__ ("stwbrx  %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));
    83. }
        ^
    84. 
    85. #if HAVE_LDBRX

libavcodec/bytestream.h:89:1: return from a call to bytestream2_put_be32
  87. DEF(unsigned int, le16, 2, AV_RL16, AV_WL16)
  88. DEF(uint64_t,     be64, 8, AV_RB64, AV_WB64)
  89. DEF(unsigned int, be32, 4, AV_RB32, AV_WB32)
      ^
  90. DEF(unsigned int, be24, 3, AV_RB24, AV_WB24)
  91. DEF(unsigned int, be16, 2, AV_RB16, AV_WB16)

libavformat/rtmpproto.c:1855:5: Skipping ff_rtmp_packet_write(): empty list of specs
1853.     bytestream2_put_be32(&pbc, rt->nb_streamid);
1854. 
1855.     ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,
          ^
1856.                                &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
1857. 

libavformat/rtmpproto.c:1858:5: 
1856.                                &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
1857. 
1858.     ff_rtmp_packet_destroy(&spkt);
          ^
1859. 
1860.     return ret;

libavformat/rtmppkt.c:419:1: start of procedure ff_rtmp_packet_destroy()
  417. }
  418. 
  419. void ff_rtmp_packet_destroy(RTMPPacket *pkt)
       ^
  420. {
  421.     if (!pkt)

libavformat/rtmppkt.c:421:10: Taking false branch
  419. void ff_rtmp_packet_destroy(RTMPPacket *pkt)
  420. {
  421.     if (!pkt)
                ^
  422.         return;
  423.     av_freep(&pkt->data);

libavformat/rtmppkt.c:423:5: Skipping av_freep(): empty list of specs
  421.     if (!pkt)
  422.         return;
  423.     av_freep(&pkt->data);
           ^
  424.     pkt->size = 0;
  425. }

libavformat/rtmppkt.c:424:5: 
  422.         return;
  423.     av_freep(&pkt->data);
  424.     pkt->size = 0;
           ^
  425. }
  426. 

libavformat/rtmppkt.c:425:1: return from a call to ff_rtmp_packet_destroy
  423.     av_freep(&pkt->data);
  424.     pkt->size = 0;
  425. }
       ^
  426. 
  427. int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end)

libavformat/rtmpproto.c:1860:5: 
1858.     ff_rtmp_packet_destroy(&spkt);
1859. 
1860.     return ret;
          ^
1861. }
1862. 

libavformat/rtmpproto.c:1861:1: return from a call to write_begin
1859. 
1860.     return ret;
1861. }
      ^
1862. 
1863. static int write_status(URLContext *s, RTMPPacket *pkt,
