Move the allocation of the DRAM line buffer in the sample download code
path closer to the location where that buffer is used and gets released.
devc = sdi->priv;
dl_events_in_line = 64 * 7;
- dram_line = g_try_malloc0(chunks_per_read * sizeof(*dram_line));
- if (!dram_line)
- return FALSE;
-
sr_info("Downloading sample data.");
devc->state.state = SIGMA_DOWNLOAD;
} else {
dl_first_line = 0;
}
+ dram_line = g_try_malloc0(chunks_per_read * sizeof(*dram_line));
+ if (!dram_line)
+ return FALSE;
dl_lines_done = 0;
while (dl_lines_total > dl_lines_done) {
/* We can download only up-to 32 DRAM lines in one go! */