libavformat/matroskaenc.c:366: error: Memory Leak
  memory dynamically allocated to `return` by call to `av_realloc()` at line 361, column 15 is not reachable after line 366, column 9.

libavformat/matroskaenc.c:357:1: start of procedure mkv_add_cuepoint()
355. }
356. 
357. static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)
     ^
358. {
359.     mkv_cuepoint *entries = cues->entries;

libavformat/matroskaenc.c:359:5: 
357. static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)
358. {
359.     mkv_cuepoint *entries = cues->entries;
         ^
360. 
361.     entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));

libavformat/matroskaenc.c:361:5: 
359.     mkv_cuepoint *entries = cues->entries;
360. 
361.     entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));
         ^
362.     if (entries == NULL)
363.         return AVERROR(ENOMEM);

libavutil/mem.c:119:1: start of procedure av_realloc()
  117. }
  118. 
  119. void *av_realloc(void *ptr, size_t size)
       ^
  120. {
  121. #if CONFIG_MEMALIGN_HACK

libavutil/mem.c:126:8: Taking false branch
  124. 
  125.     /* let's disallow possible ambiguous cases */
  126.     if(size > (INT_MAX-16) )
              ^
  127.         return NULL;
  128. 

libavutil/mem.c:135:5: 
  133.     return (char*)realloc((char*)ptr - diff, size + diff) + diff;
  134. #else
  135.     return realloc(ptr, size);
           ^
  136. #endif
  137. }

libavutil/mem.c:137:1: return from a call to av_realloc
  135.     return realloc(ptr, size);
  136. #endif
  137. }
       ^
  138. 
  139. void av_free(void *ptr)

libavformat/matroskaenc.c:362:9: Taking false branch
360. 
361.     entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));
362.     if (entries == NULL)
             ^
363.         return AVERROR(ENOMEM);
364. 

libavformat/matroskaenc.c:365:9: Taking true branch
363.         return AVERROR(ENOMEM);
364. 
365.     if (ts < 0)
             ^
366.         return 0;
367. 

libavformat/matroskaenc.c:366:9: 
364. 
365.     if (ts < 0)
366.         return 0;
             ^
367. 
368.     entries[cues->num_entries  ].pts = ts;

static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)
{
    mkv_cuepoint *entries = cues->entries;
    entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));
    if (entries == NULL)
        return AVERROR(ENOMEM);
    if (ts < 0)
        return 0;
    entries[cues->num_entries  ].pts = ts;
    entries[cues->num_entries  ].tracknum = stream + 1;
    entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset;
    cues->entries = entries;
    return 0;
}
['static int mkv_add_cuepoint(mkv_cues *cues, int stream, int64_t ts, int64_t cluster_pos)\n{\n    mkv_cuepoint *entries = cues->entries;\n    entries = av_realloc(entries, (cues->num_entries + 1) * sizeof(mkv_cuepoint));\n    if (entries == NULL)\n        return AVERROR(ENOMEM);\n    if (ts < 0)\n        return 0;\n    entries[cues->num_entries  ].pts = ts;\n    entries[cues->num_entries  ].tracknum = stream + 1;\n    entries[cues->num_entries++].cluster_pos = cluster_pos - cues->segment_offset;\n    cues->entries = entries;\n    return 0;\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) return av_malloc(size);\n    diff= ((char*)ptr)[-1];\n    return (char*)realloc((char*)ptr - diff, size + diff) + diff;\n#else\n    return realloc(ptr, size);\n#endif\n}']