If jack_set_hw_constraint() returns error, we leak the 'jack' object and
all the resources referenced by it. This patch fixes the issue by
calling snd_pcm_jack_free() before returning.
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
err = jack_set_hw_constraint(jack);
if (err < 0) {
snd_pcm_ioplug_delete(&jack->io);
+ snd_pcm_jack_free(jack);
return err;
}