avprobe.c:373: error: Memory Leak
  memory dynamically allocated by call to `av_strdup()` at line 364, column 15 is not reachable after line 373, column 5.

avprobe.c:357:1: start of procedure old_print_object_footer()
355. }
356. 
357. static void old_print_object_footer(const char *name)
     ^
358. {
359.     char *str, *p;

avprobe.c:361:10: Taking false branch
359.     char *str, *p;
360. 
361.     if (!strcmp(name, "tags"))
              ^
362.         return;
363. 

avprobe.c:364:5: 
362.         return;
363. 
364.     str = p = av_strdup(name);
         ^
365.     if (!str)
366.         return;

libavutil/mem.c:219:1: start of procedure av_strdup()
  217. }
  218. 
  219. char *av_strdup(const char *s)
       ^
  220. {
  221.     char *ptr = NULL;

libavutil/mem.c:221:5: 
  219. char *av_strdup(const char *s)
  220. {
  221.     char *ptr = NULL;
           ^
  222.     if (s) {
  223.         int len = strlen(s) + 1;

libavutil/mem.c:222:9: Taking true branch
  220. {
  221.     char *ptr = NULL;
  222.     if (s) {
               ^
  223.         int len = strlen(s) + 1;
  224.         ptr = av_realloc(NULL, len);

libavutil/mem.c:223:9: 
  221.     char *ptr = NULL;
  222.     if (s) {
  223.         int len = strlen(s) + 1;
               ^
  224.         ptr = av_realloc(NULL, len);
  225.         if (ptr)

libavutil/mem.c:224:9: 
  222.     if (s) {
  223.         int len = strlen(s) + 1;
  224.         ptr = av_realloc(NULL, len);
               ^
  225.         if (ptr)
  226.             memcpy(ptr, s, len);

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)

libavutil/mem.c:225:13: Taking true branch
  223.         int len = strlen(s) + 1;
  224.         ptr = av_realloc(NULL, len);
  225.         if (ptr)
                   ^
  226.             memcpy(ptr, s, len);
  227.     }

libavutil/mem.c:226:13: 
  224.         ptr = av_realloc(NULL, len);
  225.         if (ptr)
  226.             memcpy(ptr, s, len);
                   ^
  227.     }
  228.     return ptr;

libavutil/mem.c:228:5: 
  226.             memcpy(ptr, s, len);
  227.     }
  228.     return ptr;
           ^
  229. }
  230. 

libavutil/mem.c:229:1: return from a call to av_strdup
  227.     }
  228.     return ptr;
  229. }
       ^
  230. 
  231. char *av_strndup(const char *s, size_t len)

avprobe.c:365:10: Taking false branch
363. 
364.     str = p = av_strdup(name);
365.     if (!str)
              ^
366.         return;
367.     while (*p) {

avprobe.c:367:12: Loop condition is true. Entering loop body
365.     if (!str)
366.         return;
367.     while (*p) {
                ^
368.         *p = av_toupper(*p);
369.         p++;

avprobe.c:368:9: 
366.         return;
367.     while (*p) {
368.         *p = av_toupper(*p);
             ^
369.         p++;
370.     }

libavutil/avstring.h:182:1: start of procedure av_toupper()
  180.  * Locale-independent conversion of ASCII characters to uppercase.
  181.  */
  182. static inline av_const int av_toupper(int c)
       ^
  183. {
  184.     if (c >= 'a' && c <= 'z')

libavutil/avstring.h:184:9: Taking false branch
  182. static inline av_const int av_toupper(int c)
  183. {
  184.     if (c >= 'a' && c <= 'z')
               ^
  185.         c ^= 0x20;
  186.     return c;

libavutil/avstring.h:186:5: 
  184.     if (c >= 'a' && c <= 'z')
  185.         c ^= 0x20;
  186.     return c;
           ^
  187. }
  188. 

libavutil/avstring.h:187:1: return from a call to av_toupper
  185.         c ^= 0x20;
  186.     return c;
  187. }
       ^
  188. 
  189. /**

avprobe.c:369:9: 
367.     while (*p) {
368.         *p = av_toupper(*p);
369.         p++;
             ^
370.     }
371. 

avprobe.c:367:12: Loop condition is false. Leaving loop
365.     if (!str)
366.         return;
367.     while (*p) {
                ^
368.         *p = av_toupper(*p);
369.         p++;

avprobe.c:372:5: 
370.     }
371. 
372.     avio_printf(probe_out, "[/%s]\n", str);
         ^
373.     av_freep(&str);
374. }

libavformat/aviobuf.c:963:1: start of procedure avio_printf()
  961. }
  962. 
  963. int avio_printf(AVIOContext *s, const char *fmt, ...)
       ^
  964. {
  965.     va_list ap;

libavformat/aviobuf.c:969:5: 
  967.     int ret;
  968. 
  969.     va_start(ap, fmt);
           ^
  970.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
  971.     va_end(ap);

libavformat/aviobuf.c:970:5: 
  968. 
  969.     va_start(ap, fmt);
  970.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
           ^
  971.     va_end(ap);
  972.     avio_write(s, buf, strlen(buf));

libavformat/aviobuf.c:971:5: 
  969.     va_start(ap, fmt);
  970.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
  971.     va_end(ap);
           ^
  972.     avio_write(s, buf, strlen(buf));
  973.     return ret;

libavformat/aviobuf.c:972:5: Skipping avio_write(): empty list of specs
  970.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
  971.     va_end(ap);
  972.     avio_write(s, buf, strlen(buf));
           ^
  973.     return ret;
  974. }

libavformat/aviobuf.c:973:5: 
  971.     va_end(ap);
  972.     avio_write(s, buf, strlen(buf));
  973.     return ret;
           ^
  974. }
  975. 

libavformat/aviobuf.c:974:1: return from a call to avio_printf
  972.     avio_write(s, buf, strlen(buf));
  973.     return ret;
  974. }
       ^
  975. 
  976. int avio_pause(AVIOContext *s, int pause)

avprobe.c:373:5: Skipping av_freep(): empty list of specs
371. 
372.     avio_printf(probe_out, "[/%s]\n", str);
373.     av_freep(&str);
         ^
374. }
375. 

static void old_print_object_footer(const char *name)
{
    char *str, *p;
    if (!strcmp(name, "tags"))
        return;
    str = p = av_strdup(name);
    if (!str)
        return;
    while (*p) {
        *p = av_toupper(*p);
        p++;
    }
    avio_printf(probe_out, "[/%s]\n", str);
    av_freep(&str);
}
['static void old_print_object_footer(const char *name)\n{\n    char *str, *p;\n    if (!strcmp(name, "tags"))\n        return;\n    str = p = av_strdup(name);\n    if (!str)\n        return;\n    while (*p) {\n        *p = av_toupper(*p);\n        p++;\n    }\n    avio_printf(probe_out, "[/%s]\\n", str);\n    av_freep(&str);\n}', 'char *av_strdup(const char *s)\n{\n    char *ptr = NULL;\n    if (s) {\n        int len = strlen(s) + 1;\n        ptr = av_realloc(NULL, len);\n        if (ptr)\n            memcpy(ptr, s, len);\n    }\n    return ptr;\n}', 'void *av_realloc(void *ptr, size_t size)\n{\n#if CONFIG_MEMALIGN_HACK\n    int diff;\n#endif\n    if (size > (INT_MAX - 16))\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    if (!ptr)\n        return av_malloc(size);\n    diff = ((char *)ptr)[-1];\n    return (char *)realloc((char *)ptr - diff, size + diff) + diff;\n#elif HAVE_ALIGNED_MALLOC\n    return _aligned_realloc(ptr, size, 32);\n#else\n    return realloc(ptr, size);\n#endif\n}', "static inline av_const int av_toupper(int c)\n{\n    if (c >= 'a' && c <= 'z')\n        c ^= 0x20;\n    return c;\n}", 'int avio_printf(AVIOContext *s, const char *fmt, ...)\n{\n    va_list ap;\n    char buf[4096];\n    int ret;\n    va_start(ap, fmt);\n    ret = vsnprintf(buf, sizeof(buf), fmt, ap);\n    va_end(ap);\n    avio_write(s, buf, strlen(buf));\n    return ret;\n}']