avtools/cmdutils.c:1417: error: Memory Leak
  memory dynamically allocated by call to `av_strdup()` at line 1392, column 13 is not reachable after line 1417, column 5.

avtools/cmdutils.c:1387:1: start of procedure show_help()
1385. #endif
1386. 
1387. int show_help(void *optctx, const char *opt, const char *arg)
      ^
1388. {
1389.     char *topic, *par;

avtools/cmdutils.c:1390:5: 
1388. {
1389.     char *topic, *par;
1390.     av_log_set_callback(log_callback_help);
          ^
1391. 
1392.     topic = av_strdup(arg ? arg : "");

libavutil/log.c:215:1: start of procedure av_log_set_callback()
  213. }
  214. 
  215. void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
       ^
  216. {
  217.     av_log_callback = callback;

libavutil/log.c:217:5: 
  215. void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
  216. {
  217.     av_log_callback = callback;
           ^
  218. }
  219. 

libavutil/log.c:218:1: return from a call to av_log_set_callback
  216. {
  217.     av_log_callback = callback;
  218. }
       ^
  219. 
  220. static void missing_feature_sample(int sample, void *avc, const char *msg,

avtools/cmdutils.c:1392:23: Condition is true
1390.     av_log_set_callback(log_callback_help);
1391. 
1392.     topic = av_strdup(arg ? arg : "");
                            ^
1393.     if (!topic)
1394.         return AVERROR(ENOMEM);

avtools/cmdutils.c:1392:5: 
1390.     av_log_set_callback(log_callback_help);
1391. 
1392.     topic = av_strdup(arg ? arg : "");
          ^
1393.     if (!topic)
1394.         return AVERROR(ENOMEM);

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/cmdutils.c:1393:10: Taking false branch
1391. 
1392.     topic = av_strdup(arg ? arg : "");
1393.     if (!topic)
               ^
1394.         return AVERROR(ENOMEM);
1395.     par = strchr(topic, '=');

avtools/cmdutils.c:1395:5: 
1393.     if (!topic)
1394.         return AVERROR(ENOMEM);
1395.     par = strchr(topic, '=');
          ^
1396.     if (par)
1397.         *par++ = 0;

avtools/cmdutils.c:1396:9: Taking false branch
1394.         return AVERROR(ENOMEM);
1395.     par = strchr(topic, '=');
1396.     if (par)
              ^
1397.         *par++ = 0;
1398. 

avtools/cmdutils.c:1399:10: Taking false branch
1397.         *par++ = 0;
1398. 
1399.     if (!*topic) {
               ^
1400.         show_help_default(topic, par);
1401.     } else if (!strcmp(topic, "decoder")) {

avtools/cmdutils.c:1401:17: Taking true branch
1399.     if (!*topic) {
1400.         show_help_default(topic, par);
1401.     } else if (!strcmp(topic, "decoder")) {
                      ^
1402.         show_help_codec(par, 0);
1403.     } else if (!strcmp(topic, "encoder")) {

avtools/cmdutils.c:1402:9: 
1400.         show_help_default(topic, par);
1401.     } else if (!strcmp(topic, "decoder")) {
1402.         show_help_codec(par, 0);
              ^
1403.     } else if (!strcmp(topic, "encoder")) {
1404.         show_help_codec(par, 1);

avtools/cmdutils.c:1258:1: start of procedure show_help_codec()
  1256. }
  1257. 
  1258. static void show_help_codec(const char *name, int encoder)
        ^
  1259. {
  1260.     const AVCodecDescriptor *desc;

avtools/cmdutils.c:1263:10: Taking false branch
  1261.     const AVCodec *codec;
  1262. 
  1263.     if (!name) {
                 ^
  1264.         av_log(NULL, AV_LOG_ERROR, "No codec name specified.\n");
  1265.         return;

avtools/cmdutils.c:1268:13: Condition is false
  1266.     }
  1267. 
  1268.     codec = encoder ? avcodec_find_encoder_by_name(name) :
                    ^
  1269.                       avcodec_find_decoder_by_name(name);
  1270. 

avtools/cmdutils.c:1268:5: 
  1266.     }
  1267. 
  1268.     codec = encoder ? avcodec_find_encoder_by_name(name) :
            ^
  1269.                       avcodec_find_decoder_by_name(name);
  1270. 

avtools/cmdutils.c:1271:9: Taking true branch
  1269.                       avcodec_find_decoder_by_name(name);
  1270. 
  1271.     if (codec)
                ^
  1272.         print_codec(codec);
  1273.     else if ((desc = avcodec_descriptor_get_by_name(name))) {

avtools/cmdutils.c:1272:9: Skipping print_codec(): empty list of specs
  1270. 
  1271.     if (codec)
  1272.         print_codec(codec);
                ^
  1273.     else if ((desc = avcodec_descriptor_get_by_name(name))) {
  1274.         int printed = 0;

avtools/cmdutils.c:1271:5: 
  1269.                       avcodec_find_decoder_by_name(name);
  1270. 
  1271.     if (codec)
            ^
  1272.         print_codec(codec);
  1273.     else if ((desc = avcodec_descriptor_get_by_name(name))) {

avtools/cmdutils.c:1291:1: return from a call to show_help_codec
  1289.                name);
  1290.     }
  1291. }
        ^
  1292. 
  1293. static void show_help_demuxer(const char *name)

avtools/cmdutils.c:1417:5: Skipping av_freep(): empty list of specs
1415.     }
1416. 
1417.     av_freep(&topic);
          ^
1418.     return 0;
1419. }

int show_help(void *optctx, const char *opt, const char *arg)
{
    char *topic, *par;
    av_log_set_callback(log_callback_help);
    topic = av_strdup(arg ? arg : "");
    if (!topic)
        return AVERROR(ENOMEM);
    par = strchr(topic, '=');
    if (par)
        *par++ = 0;
    if (!*topic) {
        show_help_default(topic, par);
    } else if (!strcmp(topic, "decoder")) {
        show_help_codec(par, 0);
    } else if (!strcmp(topic, "encoder")) {
        show_help_codec(par, 1);
    } else if (!strcmp(topic, "demuxer")) {
        show_help_demuxer(par);
    } else if (!strcmp(topic, "muxer")) {
        show_help_muxer(par);
#if CONFIG_AVFILTER
    } else if (!strcmp(topic, "filter")) {
        show_help_filter(par);
#endif
    } else {
        show_help_default(topic, par);
    }
    av_freep(&topic);
    return 0;
}
['int show_help(void *optctx, const char *opt, const char *arg)\n{\n    char *topic, *par;\n    av_log_set_callback(log_callback_help);\n    topic = av_strdup(arg ? arg : "");\n    if (!topic)\n        return AVERROR(ENOMEM);\n    par = strchr(topic, \'=\');\n    if (par)\n        *par++ = 0;\n    if (!*topic) {\n        show_help_default(topic, par);\n    } else if (!strcmp(topic, "decoder")) {\n        show_help_codec(par, 0);\n    } else if (!strcmp(topic, "encoder")) {\n        show_help_codec(par, 1);\n    } else if (!strcmp(topic, "demuxer")) {\n        show_help_demuxer(par);\n    } else if (!strcmp(topic, "muxer")) {\n        show_help_muxer(par);\n#if CONFIG_AVFILTER\n    } else if (!strcmp(topic, "filter")) {\n        show_help_filter(par);\n#endif\n    } else {\n        show_help_default(topic, par);\n    }\n    av_freep(&topic);\n    return 0;\n}', 'void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))\n{\n    av_log_callback = callback;\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 void show_help_codec(const char *name, int encoder)\n{\n    const AVCodecDescriptor *desc;\n    const AVCodec *codec;\n    if (!name) {\n        av_log(NULL, AV_LOG_ERROR, "No codec name specified.\\n");\n        return;\n    }\n    codec = encoder ? avcodec_find_encoder_by_name(name) :\n                      avcodec_find_decoder_by_name(name);\n    if (codec)\n        print_codec(codec);\n    else if ((desc = avcodec_descriptor_get_by_name(name))) {\n        int printed = 0;\n        while ((codec = next_codec_for_id(desc->id, codec, encoder))) {\n            printed = 1;\n            print_codec(codec);\n        }\n        if (!printed) {\n            av_log(NULL, AV_LOG_ERROR, "Codec \'%s\' is known to Libav, "\n                   "but no %s for it are available. Libav might need to be "\n                   "recompiled with additional external libraries.\\n",\n                   name, encoder ? "encoders" : "decoders");\n        }\n    } else {\n        av_log(NULL, AV_LOG_ERROR, "Codec \'%s\' is not recognized by Libav.\\n",\n               name);\n    }\n}']