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

libavformat/rtmpproto.c:1815:1: start of procedure write_begin()
1813. }
1814. 
1815. static int write_begin(URLContext *s)
      ^
1816. {
1817.     RTMPContext *rt = s->priv_data;

libavformat/rtmpproto.c:1817:5: 
1815. static int write_begin(URLContext *s)
1816. {
1817.     RTMPContext *rt = s->priv_data;
          ^
1818.     PutByteContext pbc;
1819.     RTMPPacket spkt = { 0 };

libavformat/rtmpproto.c:1819:5: 
1817.     RTMPContext *rt = s->priv_data;
1818.     PutByteContext pbc;
1819.     RTMPPacket spkt = { 0 };
          ^
1820.     int ret;
1821. 

libavformat/rtmpproto.c:1823:9: 
1821. 
1822.     // Send Stream Begin 1
1823.     if ((ret = ff_rtmp_packet_create(&spkt, RTMP_NETWORK_CHANNEL,
              ^
1824.                                      RTMP_PT_PING, 0, 6)) < 0) {
1825.         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:107:1: start of procedure av_realloc()
    105. }
    106. 
    107. void *av_realloc(void *ptr, size_t size)
         ^
    108. {
    109.     /* let's disallow possibly ambiguous cases */

libavutil/mem.c:110:9: Taking false branch
    108. {
    109.     /* let's disallow possibly ambiguous cases */
    110.     if (size > (INT_MAX - 16))
                 ^
    111.         return NULL;
    112. 

libavutil/mem.c:116:5: 
    114.     return _aligned_realloc(ptr, size, 32);
    115. #else
    116.     return realloc(ptr, size);
             ^
    117. #endif
    118. }

libavutil/mem.c:118:1: return from a call to av_realloc
    116.     return realloc(ptr, size);
    117. #endif
    118. }
         ^
    119. 
    120. 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:1823:9: Taking false branch
1821. 
1822.     // Send Stream Begin 1
1823.     if ((ret = ff_rtmp_packet_create(&spkt, RTMP_NETWORK_CHANNEL,
              ^
1824.                                      RTMP_PT_PING, 0, 6)) < 0) {
1825.         av_log(s, AV_LOG_ERROR, "Unable to create response packet\n");

libavformat/rtmpproto.c:1829:5: 
1827.     }
1828. 
1829.     bytestream2_init_writer(&pbc, spkt.data, spkt.size);
          ^
1830.     bytestream2_put_be16(&pbc, 0);          // 0 -> Stream Begin
1831.     bytestream2_put_be32(&pbc, rt->nb_streamid);

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

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

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

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

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

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

libavformat/rtmpproto.c:1830:5: 
1828. 
1829.     bytestream2_init_writer(&pbc, spkt.data, spkt.size);
1830.     bytestream2_put_be16(&pbc, 0);          // 0 -> Stream Begin
          ^
1831.     bytestream2_put_be32(&pbc, rt->nb_streamid);
1832. 

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

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

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

libavutil/ppc/intreadwrite.h:54:1: start of procedure av_write_bswap16()
    52. }
    53. 
    54. static av_always_inline void av_write_bswap16(void *p, uint16_t v)
        ^
    55. {
    56.     __asm__ ("sthbrx  %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));

libavutil/ppc/intreadwrite.h:56:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
    54. static av_always_inline void av_write_bswap16(void *p, uint16_t v)
    55. {
    56.     __asm__ ("sthbrx  %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));
            ^
    57. }
    58. 

libavutil/ppc/intreadwrite.h:57:1: return from a call to av_write_bswap16
    55. {
    56.     __asm__ ("sthbrx  %1, %y0" : "=Z"(*(uint16_t*)p) : "r"(v));
    57. }
        ^
    58. 
    59. static av_always_inline uint32_t av_read_bswap32(const void *p)

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

libavformat/rtmpproto.c:1831:5: 
1829.     bytestream2_init_writer(&pbc, spkt.data, spkt.size);
1830.     bytestream2_put_be16(&pbc, 0);          // 0 -> Stream Begin
1831.     bytestream2_put_be32(&pbc, rt->nb_streamid);
          ^
1832. 
1833.     ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,

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

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

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

libavutil/ppc/intreadwrite.h:66:1: start of procedure av_write_bswap32()
    64. }
    65. 
    66. static av_always_inline void av_write_bswap32(void *p, uint32_t v)
        ^
    67. {
    68.     __asm__ ("stwbrx  %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));

libavutil/ppc/intreadwrite.h:68:5: Skipping __infer_skip_gcc_asm_stmt(): function or method not found
    66. static av_always_inline void av_write_bswap32(void *p, uint32_t v)
    67. {
    68.     __asm__ ("stwbrx  %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));
            ^
    69. }
    70. 

libavutil/ppc/intreadwrite.h:69:1: return from a call to av_write_bswap32
    67. {
    68.     __asm__ ("stwbrx  %1, %y0" : "=Z"(*(uint32_t*)p) : "r"(v));
    69. }
        ^
    70. 
    71. #if HAVE_LDBRX

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

libavformat/rtmpproto.c:1833:5: Skipping ff_rtmp_packet_write(): empty list of specs
1831.     bytestream2_put_be32(&pbc, rt->nb_streamid);
1832. 
1833.     ret = ff_rtmp_packet_write(rt->stream, &spkt, rt->out_chunk_size,
          ^
1834.                                &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
1835. 

libavformat/rtmpproto.c:1836:5: 
1834.                                &rt->prev_pkt[1], &rt->nb_prev_pkt[1]);
1835. 
1836.     ff_rtmp_packet_destroy(&spkt);
          ^
1837. 
1838.     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:1838:5: 
1836.     ff_rtmp_packet_destroy(&spkt);
1837. 
1838.     return ret;
          ^
1839. }
1840. 

libavformat/rtmpproto.c:1839:1: return from a call to write_begin
1837. 
1838.     return ret;
1839. }
      ^
1840. 
1841. static int write_status(URLContext *s, RTMPPacket *pkt,
