Remove unnecessary null pointer checks #21

Closed
opened 2026-01-29 20:29:10 +00:00 by claunia · 2 comments
Owner

Originally created by @elfring on GitHub (Sep 11, 2015).

An extra null pointer check is not needed in functions like the following.

Originally created by @elfring on GitHub (Sep 11, 2015). [An extra null pointer check is not needed](http://pubs.opengroup.org/onlinepubs/9699919799/functions/free.html) in functions like the following. - [BrotliFileIn destructor](https://github.com/google/brotli/blob/55a40ce214be844b8860ef46e3ba321324542679/enc/streams.cc#L95) - [BrotliHuffmanTreeGroupRelease](https://github.com/google/brotli/blob/7f7a2fb48cec63c0459ec6b6e7260810bfb01819/dec/huffman.c#L317) - [BrotliStateCleanupAfterMetablock](https://github.com/google/brotli/blob/53dbee731c83d3a8bb5e6e233bb4227e8de26dd2/dec/state.c#L100)
Author
Owner

@eustas commented on GitHub (Oct 6, 2015):

Nice catch. Fixed.

Thank you.

@eustas commented on GitHub (Oct 6, 2015): Nice catch. Fixed. Thank you.
Author
Owner

@elfring commented on GitHub (Oct 6, 2015):

Thanks for your small source code improvement.

@elfring commented on GitHub (Oct 6, 2015): Thanks for [your small source code improvement](https://github.com/google/brotli/commit/d3eb6ecb9a9191a516ec83038c05f219e1012664#diff-93fb75c9f74d54a8ae6f89bb2e1a363eL318).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#21