]> sigrok.org Git - libsigrok.git/commit
hameg-hmo: Release enabled channels when acquisition start fails
authorGerhard Sittig <redacted>
Sun, 6 Nov 2016 11:08:02 +0000 (12:08 +0100)
committerUwe Hermann <redacted>
Sat, 7 Jan 2017 14:51:32 +0000 (15:51 +0100)
commit40a75c8e9732992e80e055c995edd73f1ff07f2a
treeee3d254d7ab8d591913ee26214f08dda67884f59
parent2d224dbae735e5d3ea39cbafcd6d280cbd112c31
hameg-hmo: Release enabled channels when acquisition start fails

Commit db81fbb58261 made sure to release a potentially previously
allocated list of enabled channels before (re-)building the list in the
current invocation of acquisition start.

This commit frees the memory in the error path near the failed creation
already, which reduces the period of time where unused resources are
held, and eliminates a memory leak when acquisition is not stopped after
failed start.

Both approaches can coexist. Freeing an empty list is perfectly fine.
src/hardware/hameg-hmo/api.c