The following snipped causes a doubleFree false positive, since fdopen(3) is treated to always deallocate a file descriptor resource, and not only on success:
fdopen(3) only transforms the given file descriptor to a stream on success, not on failure.
Same also applies to fdopendir(3), but this functions is currently not registered as deallocator for file descriptor resources.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The following snipped causes a doubleFree false positive, since fdopen(3) is treated to always deallocate a file descriptor resource, and not only on success:
Report:
fdopen(3) only transforms the given file descriptor to a stream on success, not on failure.
Same also applies to fdopendir(3), but this functions is currently not registered as deallocator for file descriptor resources.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12781