Opened 15 years ago

#1349 new defect

libao2/ao_alsa.c:141: Memory leak: mix_name

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

Description

In file libao2/ao_alsa.c:141:
Variable mix_name leaks memory if CONTROL_TRUE is returned.

if(mixer_channel) {

char *test_mix_index;

mix_name = strdup(mixer_channel);
if ((test_mix_index = strchr(mix_name, ','))){

*test_mix_index = 0;
test_mix_index++;
mix_index = strtol(test_mix_index, &test_mix_index, 0);

if (*test_mix_index){

mp_msg(MSGT_AO,MSGL_ERR,

MSGTR_AO_ALSA_InvalidMixerIndexDefaultingToZero);

mix_index = 0 ;

}

}

}
if(mixer_device) card = mixer_device;

if(ao_data.format == AF_FORMAT_AC3)

return CONTROL_TRUE;

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

Change History (0)

Note: See TracTickets for help on using tickets.