28 Sep
2018
28 Sep
'18
11:27 p.m.
If us_set_hw_constraint() returns error, we leak the 'us' object and all the resources referenced by it. This patch fixes the issue by calling us_free() before returning.
Signed-off-by: Andre Guedes andre.guedes@intel.com --- usb_stream/pcm_usb_stream.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/usb_stream/pcm_usb_stream.c b/usb_stream/pcm_usb_stream.c index 94c83a7..eb4ca98 100644 --- a/usb_stream/pcm_usb_stream.c +++ b/usb_stream/pcm_usb_stream.c @@ -455,6 +455,7 @@ static int snd_pcm_us_open(snd_pcm_t **pcmp, const char *name, err = us_set_hw_constraint(us); if (err < 0) { snd_pcm_ioplug_delete(&us->io); + us_free(us); return err; }
--
2.14.4