[pacman-dev] [PATCH 0/4] Smatch warning fixes

Silvan Jegen s.jegen at gmail.com
Tue Jan 28 11:50:41 EST 2014


Hi 

I ran smatch[1] on the pacman source code and it reported a few minor
issues.

Three out of four of the following patches are checks for NULL when
freeing memory which are strictly not necessary since calling free with
a NULL argument is a no-op.

The last patch moves a NULL check before a pointer dereference which
should be the correct place to put it.


Cheers,

Silvan


[1] http://smatch.sourceforge.net/


Silvan Jegen (4):
  Remove unneeded NULL check
  Another unneeded NULL check removed
  Another NULL check removed
  Move NULL check before dereference

 src/pacman/pacman.c | 16 +++++++---------
 src/pacman/util.c   | 10 ++++------
 src/util/pacsort.c  |  5 +----
 3 files changed, 12 insertions(+), 19 deletions(-)

-- 
1.8.5.3



More information about the pacman-dev mailing list