]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Fix memory leaks
authorTakashi Iwai <tiwai@suse.de>
Thu, 9 Feb 2006 11:37:04 +0000 (11:37 +0000)
committerTakashi Iwai <tiwai@suse.de>
Thu, 9 Feb 2006 11:37:04 +0000 (11:37 +0000)
Fixed small memory leaks in the parser.

src/control/setup.c

index 5af20375b4b32a5027a45109bbea67cf4aa6560f..c0848c3e9a9c8b25f1b1f5a66ae10b489daebd11 100644 (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);
                        if (err < 0) {
                                SNDERR("field %s is not a boolean", id);
+                               free(tmp);
                                goto _err;
                        }
                        lock = err;
+                       free(tmp);
                        continue;
                }
                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);
                        if (err < 0) {
                                SNDERR("field %s is not a boolean", id);
+                               free(tmp);
                                goto _err;
                        }
                        preserve = err;
+                       free(tmp);
                        continue;
                }
                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);
                        if (err < 0) {
                                SNDERR("field %s is not a boolean", id);
+                               free(tmp);
                                goto _err;
                        }
                        optional = err;
+                       free(tmp);
                        continue;
                }
                SNDERR("Unknown field %s", id);