From: fenugrec Date: Mon, 20 Nov 2023 22:30:48 +0000 (-0500) Subject: siglent-sds: incorrect g_array_free call X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=c78fa9cf9416260e018c131f72e9115302deba7f;p=libsigrok.git siglent-sds: incorrect g_array_free call Since we are not keeping the array's data, arg must be TRUE to free it. reported by Fr3ya on github as PR #207 --- diff --git a/src/hardware/siglent-sds/protocol.c b/src/hardware/siglent-sds/protocol.c index ee02fd28..d59e52cb 100644 --- a/src/hardware/siglent-sds/protocol.c +++ b/src/hardware/siglent-sds/protocol.c @@ -412,10 +412,10 @@ static int siglent_sds_get_digital(const struct sr_dev_inst *sdi, struct sr_chan /* Clear the buffers to prepare for the new samples */ if (ch->index < 8) { - g_array_free(data_low_channels, FALSE); + g_array_free(data_low_channels, TRUE); data_low_channels = g_array_new(FALSE, FALSE, sizeof(uint8_t)); } else { - g_array_free(data_high_channels, FALSE); + g_array_free(data_high_channels, TRUE); data_high_channels = g_array_new(FALSE, FALSE, sizeof(uint8_t)); }