Opened 11 years ago

Closed 9 years ago

#1351 closed defect (fixed)

libmpcodecs/ad_speex.c:44: Memory leak: ctx

Reported by: dvice_null@… Owned by: reimar
Priority: normal Component: ad
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

Description

In file libmpcodecs/ad_speex.c:44
Variable ctx seems to leak memory if 0 is returned:

context_t *ctx = calloc(1, sizeof(context_t));
const SpeexMode? *spx_mode;
const SpeexStereoState? st_st = SPEEX_STEREO_STATE_INIT; hack

if (!sh->wf
sh->wf->cbSize < 80) {

mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Missing extradata!\n");
return 0;

}

This bug was found using cppcheck: http://cppcheck.wiki.sourceforge.net/

Change History (2)

comment:1 Changed 9 years ago by compn

  • Owner changed from r_togni@… to reimar

comment:2 Changed 9 years ago by reimar

  • Resolution set to fixed
  • Status changed from new to closed

There was a second return 0 that could also cause a leak.
Both should be fixed (r32689).

Note: See TracTickets for help on using tickets.