]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zpool/zpool_main.c
cppcheck: zpool_main.c possible null pointer dereference
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 22 Jan 2021 23:03:56 +0000 (15:03 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 27 Jan 2021 00:11:46 +0000 (16:11 -0800)
commit7454d2bb8d860bb49353c8b60dc980de82296f73
tree24fdc89274a498ce10644602a71b7ace8e4c7c53
parent62d4287f279a0d184f8f332475f27af58b7aa87e
cppcheck: zpool_main.c possible null pointer dereference

Explicitly check for NULL to satisfy cppcheck that "val" can never
be NULL when passed to printf().  This looks like a false positive
since is_blank_str() can never take the false conditional branch
when passed a NULL.  But there's no harm in adding the extra check.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11508
cmd/zpool/zpool_main.c