]> sigrok.org Git - libsigrok.git/commitdiff
input/csv: eliminate unneeded zero fill of analog samples in malloc
authorMarkus Heidelberg <redacted>
Sun, 27 Nov 2022 01:14:07 +0000 (02:14 +0100)
committerGerhard Sittig <redacted>
Mon, 5 Dec 2022 20:24:41 +0000 (21:24 +0100)
Zero filling the memory for analog sample data was not harmful, but
shadowed the issue which got fixed in commit e7ed37042611. Remove it.
Which also happens to unify memory preparation again for logic and
for analog data.

src/input/csv.c

index 0750a4eb5d6e8a8a88ade9c4a20d09c03b20ed20..66ac41dc5c8a7e4bfebfa74e04031691a0386d39 100644 (file)
@@ -1452,7 +1452,7 @@ static int initial_parse(const struct sr_input *in, GString *buf)
                inc->analog_datafeed_buf_size /= sample_size;
                inc->analog_datafeed_buf_size /= inc->analog_channels;
                sample_count = inc->analog_channels * inc->analog_datafeed_buf_size;
-               inc->analog_datafeed_buffer = g_malloc0(sample_count * sample_size);
+               inc->analog_datafeed_buffer = g_malloc(sample_count * sample_size);
                if (!inc->analog_datafeed_buffer) {
                        sr_err("Cannot allocate datafeed send buffer (analog).");
                        ret = SR_ERR_MALLOC;