]> sigrok.org Git - libsigrok.git/commitdiff
victor-dmm: free in the right order
authorBert Vermeulen <redacted>
Sun, 9 Dec 2012 13:40:12 +0000 (14:40 +0100)
committerBert Vermeulen <redacted>
Sat, 15 Dec 2012 03:07:25 +0000 (04:07 +0100)
hardware/victor-dmm/api.c

index 46e8c1d5b35c61124b5dd42b03bbf334928f3c44..ae0d2a76723c177d6a56e55675af27a110eb70b0 100644 (file)
@@ -340,15 +340,15 @@ static void receive_transfer(struct libusb_transfer *transfer)
                if ((ret = libusb_submit_transfer(transfer) != 0)) {
                        sr_err("Unable to resubmit transfer: %s.",
                               libusb_error_name(ret));
-                       libusb_free_transfer(transfer);
                        g_free(transfer->buffer);
+                       libusb_free_transfer(transfer);
                        hw_dev_acquisition_stop(sdi, sdi);
                }
        } else {
                /* This was the last transfer we're going to receive, so
                 * clean up now. */
-               libusb_free_transfer(transfer);
                g_free(transfer->buffer);
+               libusb_free_transfer(transfer);
        }
 }