Opened 16 years ago
Last modified 14 years ago
#1353 new defect
stream/stream_cue.c:574: Memory leak: filename
Reported by: | Owned by: | reimar | |
---|---|---|---|
Priority: | normal | Component: | streaming |
Version: | HEAD | Severity: | normal |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
In file stream/stream_cue.c:574:
Variable filename is leaking memory when STREAM_UNSUPPORTED is returned:
filename = strdup(p->filename);
if(!filename) {
m_struct_free(&stream_opts,opts);
return STREAM_UNSUPPORTED;
}
colon = strstr(filename, ":");
if(colon) {
if(strlen(colon)>1)
track = atoi(colon+1);
*colon = 0;
}
if(!track)
track = 1;
f = cue_read_cue(filename);
if(f < 0) {
m_struct_free(&stream_opts,opts);
return STREAM_UNSUPPORTED;
}
cue_vcd_read_toc();
ret2=cue_vcd_get_track_end(track);
ret=cue_vcd_seek_to_track(track);
if(ret<0){
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_ErrTrackSelect " (seek)\n");
return STREAM_UNSUPPORTED;
}
This bug was found using cppcheck: http://cppcheck.wiki.sourceforge.net/