]> sigrok.org Git - libsigrok.git/commit - src/hardware/gmc-mh-1x-2x/api.c
gmc-mh-1x-2x: fix potential memory leak
authorGerhard Sittig <redacted>
Fri, 9 Feb 2018 17:50:53 +0000 (18:50 +0100)
committerUwe Hermann <redacted>
Fri, 9 Feb 2018 20:37:39 +0000 (21:37 +0100)
commit56e9672b118860303bc072c6d5815834d5ce63fc
tree736c84eb6fe2cbb6b4711c303a67802b071bbc89
parent0d1c51f57f31baeb3a05f511728129351f9655fd
gmc-mh-1x-2x: fix potential memory leak

The scan_2x_bd232() routine used to always prepare one spare context,
and filled it in when a device was found, just to allocate another one
and continue scanning.

Free the last allocated context unconditionally, as it was allocated
unconditionally, and never used.

This was reported by clang's scan-build.
src/hardware/gmc-mh-1x-2x/api.c