-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace magic number with constant
DEVLIST_ALLOC_INITIAL_LEN
& fix
memory leaks in calling `fido_dev_info_free` * Add preprocessor constant `DEVLIST_ALLOC_INITIAL_LEN` to replace magic number 64 in allocations of device info list. The named constant expresses meaning and makes bugs & memory-leaks due to missed code changes less likely, should one decide to change the number of slots to allocate in the device info list. * Fix the same errorneous code in freeing the device info list at three points in the code: Calling `fido_dev_info_free` with length argument `ndevs` deallocates only the filled entries of the device info list, while leaving the empty entries dangling. This does not seem to leak any data, though. The commit fixes the code to actually deallocate the whole array.
- Loading branch information
Showing
3 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters