adhd: Fix memory leak in cras_alsa_mixer.c
(9/17 leaking tests for the issue)
Free local variable mixer_name* default_controls by calling
mixer_name_free in cras_alsa_mixer_add_controls_by_name_matching.
When the function exits early by error return code, it should free it,
too.
BUG=chromium:844092
TEST=Apply full patch set and run
FEATURES="test noclean nostrip" emerge-eve adhd
and
valgrind --leak-check=full --show-leak-kinds=all alsa_mixer_unittest
Change-Id: Ibeb9f1d131baa2a913521cc873fec57d39d82051
Reviewed-on: https://chromium-review.googlesource.com/1068590
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Chih-Yang Hsia <paulhsia@google.com>
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
1 file changed