This website requires JavaScript.
Explore
Help
Sign In
development
/
git
Watch
1
Star
0
Fork
You've already forked git
0
mirror of
https://github.com/git/git
synced
2024-08-28 03:59:25 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
481df65f4f
git
/
contrib
/
coccinelle
/
free.cocci
12 lines
82 B
Plaintext
Raw
Normal View
History
Unescape
Escape
remove unnecessary NULL check before free(3) free(3) handles NULL pointers just fine. Add a semantic patch for removing unnecessary NULL checks before calling this function, and apply it on the code base. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-08 14:14:57 +00:00
@@
expression E;
@@
- if (E)
free(E);
cocci: detect useless free(3) calls Add a semantic patch for removing checks that cause free(3) to only be called with a NULL pointer, as that must be a programming mistake. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-11 13:58:44 +00:00
@@
expression E;
@@
- if (!E)
free(E);
Reference in a new issue
Copy permalink