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

avtools/avprobe.c:379:1: start of procedure old_print_object_footer()
377. }
378. 
379. static void old_print_object_footer(const char *name)
     ^
380. {
381.     char *str, *p;

avtools/avprobe.c:383:10: Taking false branch
381.     char *str, *p;
382. 
383.     if (!strcmp(name, "tags"))
              ^
384.         return;
385. 

avtools/avprobe.c:386:5: 
384.         return;
385. 
386.     str = p = av_strdup(name);
         ^
387.     if (!str)
388.         return;

libavutil/mem.c:210:1: start of procedure av_strdup()
  208. }
  209. 
  210. char *av_strdup(const char *s)
       ^
  211. {
  212.     char *ptr = NULL;

libavutil/mem.c:212:5: 
  210. char *av_strdup(const char *s)
  211. {
  212.     char *ptr = NULL;
           ^
  213.     if (s) {
  214.         int len = strlen(s) + 1;

libavutil/mem.c:213:9: Taking true branch
  211. {
  212.     char *ptr = NULL;
  213.     if (s) {
               ^
  214.         int len = strlen(s) + 1;
  215.         ptr = av_realloc(NULL, len);

libavutil/mem.c:214:9: 
  212.     char *ptr = NULL;
  213.     if (s) {
  214.         int len = strlen(s) + 1;
               ^
  215.         ptr = av_realloc(NULL, len);
  216.         if (ptr)

libavutil/mem.c:215:9: 
  213.     if (s) {
  214.         int len = strlen(s) + 1;
  215.         ptr = av_realloc(NULL, len);
               ^
  216.         if (ptr)
  217.             memcpy(ptr, s, len);

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)

libavutil/mem.c:216:13: Taking true branch
  214.         int len = strlen(s) + 1;
  215.         ptr = av_realloc(NULL, len);
  216.         if (ptr)
                   ^
  217.             memcpy(ptr, s, len);
  218.     }

libavutil/mem.c:217:13: 
  215.         ptr = av_realloc(NULL, len);
  216.         if (ptr)
  217.             memcpy(ptr, s, len);
                   ^
  218.     }
  219.     return ptr;

libavutil/mem.c:219:5: 
  217.             memcpy(ptr, s, len);
  218.     }
  219.     return ptr;
           ^
  220. }
  221. 

libavutil/mem.c:220:1: return from a call to av_strdup
  218.     }
  219.     return ptr;
  220. }
       ^
  221. 
  222. char *av_strndup(const char *s, size_t len)

avtools/avprobe.c:387:10: Taking false branch
385. 
386.     str = p = av_strdup(name);
387.     if (!str)
              ^
388.         return;
389.     while (*p) {

avtools/avprobe.c:389:12: Loop condition is true. Entering loop body
387.     if (!str)
388.         return;
389.     while (*p) {
                ^
390.         *p = av_toupper(*p);
391.         p++;

avtools/avprobe.c:390:9: 
388.         return;
389.     while (*p) {
390.         *p = av_toupper(*p);
             ^
391.         p++;
392.     }

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. /**

avtools/avprobe.c:391:9: 
389.     while (*p) {
390.         *p = av_toupper(*p);
391.         p++;
             ^
392.     }
393. 

avtools/avprobe.c:389:12: Loop condition is false. Leaving loop
387.     if (!str)
388.         return;
389.     while (*p) {
                ^
390.         *p = av_toupper(*p);
391.         p++;

avtools/avprobe.c:394:5: 
392.     }
393. 
394.     avio_printf(probe_out, "[/%s]\n", str);
         ^
395.     av_freep(&str);
396. }

libavformat/aviobuf.c:1028:1: start of procedure avio_printf()
  1026. }
  1027. 
  1028. int avio_printf(AVIOContext *s, const char *fmt, ...)
        ^
  1029. {
  1030.     va_list ap;

libavformat/aviobuf.c:1034:5: 
  1032.     int ret;
  1033. 
  1034.     va_start(ap, fmt);
            ^
  1035.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
  1036.     va_end(ap);

libavformat/aviobuf.c:1035:5: 
  1033. 
  1034.     va_start(ap, fmt);
  1035.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
            ^
  1036.     va_end(ap);
  1037.     avio_write(s, buf, strlen(buf));

libavformat/aviobuf.c:1036:5: 
  1034.     va_start(ap, fmt);
  1035.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
  1036.     va_end(ap);
            ^
  1037.     avio_write(s, buf, strlen(buf));
  1038.     return ret;

libavformat/aviobuf.c:1037:5: Skipping avio_write(): empty list of specs
  1035.     ret = vsnprintf(buf, sizeof(buf), fmt, ap);
  1036.     va_end(ap);
  1037.     avio_write(s, buf, strlen(buf));
            ^
  1038.     return ret;
  1039. }

libavformat/aviobuf.c:1038:5: 
  1036.     va_end(ap);
  1037.     avio_write(s, buf, strlen(buf));
  1038.     return ret;
            ^
  1039. }
  1040. 

libavformat/aviobuf.c:1039:1: return from a call to avio_printf
  1037.     avio_write(s, buf, strlen(buf));
  1038.     return ret;
  1039. }
        ^
  1040. 
  1041. int avio_pause(AVIOContext *s, int pause)

avtools/avprobe.c:395:5: Skipping av_freep(): empty list of specs
393. 
394.     avio_printf(probe_out, "[/%s]\n", str);
395.     av_freep(&str);
         ^
396. }
397. 

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 (size > (INT_MAX - 16))\n        return NULL;\n#if 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}']