Fix memory leaks

Fixed small memory leaks in the parser.
This commit is contained in:
Takashi Iwai 2006-02-09 11:37:04 +00:00
parent 9e86ea6902
commit 0757f70b1b

View file

@ -461,9 +461,11 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
err = snd_config_get_bool_ascii(tmp); err = snd_config_get_bool_ascii(tmp);
if (err < 0) { if (err < 0) {
SNDERR("field %s is not a boolean", id); SNDERR("field %s is not a boolean", id);
free(tmp);
goto _err; goto _err;
} }
lock = err; lock = err;
free(tmp);
continue; continue;
} }
if (strcmp(id, "preserve") == 0) { if (strcmp(id, "preserve") == 0) {
@ -474,9 +476,11 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
err = snd_config_get_bool_ascii(tmp); err = snd_config_get_bool_ascii(tmp);
if (err < 0) { if (err < 0) {
SNDERR("field %s is not a boolean", id); SNDERR("field %s is not a boolean", id);
free(tmp);
goto _err; goto _err;
} }
preserve = err; preserve = err;
free(tmp);
continue; continue;
} }
if (strcmp(id, "value") == 0) { if (strcmp(id, "value") == 0) {
@ -495,9 +499,11 @@ static int add_elem(snd_sctl_t *h, snd_config_t *_conf, snd_config_t *private_da
err = snd_config_get_bool_ascii(tmp); err = snd_config_get_bool_ascii(tmp);
if (err < 0) { if (err < 0) {
SNDERR("field %s is not a boolean", id); SNDERR("field %s is not a boolean", id);
free(tmp);
goto _err; goto _err;
} }
optional = err; optional = err;
free(tmp);
continue; continue;
} }
SNDERR("Unknown field %s", id); SNDERR("Unknown field %s", id);