]> sigrok.org Git - libsigrok.git/commitdiff
hantek-dso: Fix a memory leak.
authorPhilipp Marek <redacted>
Tue, 21 Nov 2017 15:10:33 +0000 (16:10 +0100)
committerUwe Hermann <redacted>
Thu, 11 Jan 2018 01:21:50 +0000 (02:21 +0100)
src/hardware/hantek-dso/api.c

index d86eff611c64caf1974a5db682f9a9e533ad4b38..9b7546292902184d6d4c67679269a3cbf4749d56 100644 (file)
@@ -768,6 +768,8 @@ static void LIBUSB_CALL receive_transfer(struct libusb_transfer *transfer)
                sr_dbg("End of frame, sending %d pre-trigger buffered samples.",
                        devc->samp_buffered);
                send_chunk(sdi, devc->framebuf, devc->samp_buffered);
+               g_free(devc->framebuf);
+               devc->framebuf = NULL;
 
                /* Mark the end of this frame. */
                packet.type = SR_DF_FRAME_END;