]> sigrok.org Git - libsigrok.git/commitdiff
siglent-sds: incorrect g_array_free call
authorfenugrec <redacted>
Mon, 20 Nov 2023 22:30:48 +0000 (17:30 -0500)
committerGerhard Sittig <redacted>
Tue, 21 Nov 2023 06:38:04 +0000 (07:38 +0100)
Since we are not keeping the array's data, arg must be TRUE to free it.

reported by Fr3ya on github as PR #207

src/hardware/siglent-sds/protocol.c

index ee02fd28843f0d813e6c397fc6076763c9013937..d59e52cbc1841365d88673492d951ef3d1985ac5 100644 (file)
@@ -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));
                }