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

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

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

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

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:8: Taking false branch
  122. 
  123.     /* let's disallow possible ambiguous cases */
  124.     if(size > (INT_MAX-16) )
              ^
  125.         return NULL;
  126. 

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

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

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

libavformat/matroskaenc.c:368:9: Taking true branch
366.         return AVERROR(ENOMEM);
367. 
368.     if (ts < 0)
             ^
369.         return 0;
370. 

libavformat/matroskaenc.c:369:9: 
367. 
368.     if (ts < 0)
369.         return 0;
             ^
370. 
371.     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}']