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

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

cmdutils.c:1388:5: 
1386. {
1387.     char *topic, *par;
1388.     av_log_set_callback(log_callback_help);
          ^
1389. 
1390.     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,

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

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

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)

cmdutils.c:1391:10: Taking false branch
1389. 
1390.     topic = av_strdup(arg ? arg : "");
1391.     if (!topic)
               ^
1392.         return AVERROR(ENOMEM);
1393.     par = strchr(topic, '=');

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

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

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

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

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

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

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

cmdutils.c:1266:13: Condition is false
  1264.     }
  1265. 
  1266.     codec = encoder ? avcodec_find_encoder_by_name(name) :
                    ^
  1267.                       avcodec_find_decoder_by_name(name);
  1268. 

cmdutils.c:1266:5: 
  1264.     }
  1265. 
  1266.     codec = encoder ? avcodec_find_encoder_by_name(name) :
            ^
  1267.                       avcodec_find_decoder_by_name(name);
  1268. 

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

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

cmdutils.c:1269:5: 
  1267.                       avcodec_find_decoder_by_name(name);
  1268. 
  1269.     if (codec)
            ^
  1270.         print_codec(codec);
  1271.     else if ((desc = avcodec_descriptor_get_by_name(name))) {

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

cmdutils.c:1415:5: Skipping av_freep(): empty list of specs
1413.     }
1414. 
1415.     av_freep(&topic);
          ^
1416.     return 0;
1417. }

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 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 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}']