Opened 10 years ago

Last modified 8 years ago

#1353 new defect

stream/stream_cue.c:574: Memory leak: filename

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

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/

Change History (1)

comment:1 Changed 8 years ago by compn

  • Owner changed from r_togni@… to reimar
Note: See TracTickets for help on using tickets.