[sigrok-devel] [PATCH 1/2] srzip: Fix handling of analog channels with index 0

2016-04-28 Thread Lars-Peter Clausen
0 is a valid index for a channel. Using it as the value for the terminating entry of analog_index_map causes zip_append_analog() to falsely assume that no channel was found when a packet for a channel with index 0 was received. This prevents the data for the channel to be added to the sigrok sessio

[sigrok-devel] [PATCH 2/2] srzip: zip_append_analog(): Fix memory leaks

2016-04-28 Thread Lars-Peter Clausen
zip_append_analog() does not free most of the memory it allocates. Address this by moving all sanity checks that do not rely on anything else at the beginning of the function before any allocations are done. And then make sure to properly free all allocated memory on all paths leaving the function.