Opened 15 years ago

Closed 13 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: no Analyzed by developer: no

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 by compn, 13 years ago

Owner: changed from r_togni@… to reimar

comment:2 by reimar, 13 years ago

Resolution: fixed
Status: newclosed

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.