Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Unnecessary null checks before freeing #108

Open
1 task done
ariccio opened this issue May 3, 2018 · 0 comments
Open
1 task done

Unnecessary null checks before freeing #108

ariccio opened this issue May 3, 2018 · 0 comments

Comments

@ariccio
Copy link

ariccio commented May 3, 2018

I have:

  • searched open and closed issues for duplicates

Bug description

I was just reading through the code as a matter of curiosity - I've always loved signal, and wanted to see the C implementation - and noticed that you're checking if a pointer is null many times before freeing them. This is perfectly valid, but absolutely not necessary, as free always checks for this on it's own. It thus leads to unnecessary code bloat. Nothing wrong with saving a few bytes!

Actual result: extra generated code, thus extra bloat.

Edit: see signal_protocol.c for examples.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant