V2: Coverity / static analysis based cleanups

Dirk Hohndel dirk at hohndel.org
Wed Jan 3 11:35:03 PST 2018


This is the second version of a series of 14 patches against the current
tip of the Subsurface-branch of libdivecomputer. I believe that all of
them should apply to upstream master (but haven't verified that).

I have incorporated Jef's feedback on the first version. One change
compared to my email responses to that feedback is that I ended up not
modifying patch 12/14 (consistently check return value of iostream) as it
made the code really ugly and as Jef said, not resetting the timeout
doesn't really matter.

Linus, based on your feedback and Jef's comment I rewrote 7/14; can you
please double check that I didn't mess this up by combining it all in one
operation?

Happy to get more feedback / comments.

Thanks

/D

[PATCH 01/14] Cleanup: correctly handle upper bound of array
[PATCH 02/14] Cleanup: avoid memory leaks
[PATCH 03/14] Cleanup: avoid memory leak
[PATCH 04/14] Cleanup: avoid memory leak
[PATCH 05/14] Cleanup: avoid memory leak
[PATCH 06/14] Cleanup: ensure string is 0 terminated
[PATCH 07/14] Cleanup: avoid undefined shift operation
[PATCH 08/14] Cleanup: remove dead code and return the correct return
[PATCH 09/14] Cleanup: dc_buffer_clear() should be a void function
[PATCH 10/14] Cleanup: check return value of ioctl()
[PATCH 11/14] Cleanup: check error return values of buffer handling
[PATCH 12/14] Cleanup: consistently check return value of iostream
[PATCH 13/14] Cleanup: bail on error
[PATCH 14/14] Cleanup: remove confusing NULL check



More information about the devel mailing list