diff options
author | Daniel Drake <dsd@gentoo.org> | 2008-03-20 21:07:00 +0000 |
---|---|---|
committer | Daniel Drake <dsd@gentoo.org> | 2008-03-20 21:19:48 +0000 |
commit | 88884ae4bbe721dac117d5190303cb67852fa5d3 (patch) | |
tree | 5e24d5208e5010e09c8554dbff61b59ddee6131b /libusb/libusb.h | |
parent | ead09cde6895df0034a685516987ce253575e9a7 (diff) | |
download | libusb-88884ae4bbe721dac117d5190303cb67852fa5d3.tar.gz |
Save transfer flags before invoking callback
The callback may free the transfer, in which case we can't read the flags
after it has returned.
Diffstat (limited to 'libusb/libusb.h')
-rw-r--r-- | libusb/libusb.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libusb/libusb.h b/libusb/libusb.h index f326afc..a306af9 100644 --- a/libusb/libusb.h +++ b/libusb/libusb.h @@ -521,7 +521,10 @@ enum libusb_transfer_flags { /** Automatically free() transfer buffer during libusb_free_transfer() */ LIBUSB_TRANSFER_FREE_BUFFER = 1<<1, - /** Automatically call libusb_free_transfer() after callback returns */ + /** Automatically call libusb_free_transfer() after callback returns. + * If this flag is set, it is illegal to call libusb_free_transfer() + * from your transfer callback, as this will result in a double-free + * when this flag is acted upon. */ LIBUSB_TRANSFER_FREE_TRANSFER = 1<<2, }; |