libmultipath: initialize return value in dm_reassign_tables

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Terminate string in sysfs_attr_get_value()

The value argument for sysfs_attr_get_value() might be shorter
than the amount read from sysfs, so we need to terminate the
resulting string correctly.
Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Terminate link destination in devt2devname

readlink() will not terminate the link destination, so we need
to do it by hand.
Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmpathpersist: Close filedescriptor on exit

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: close fd in uxclnt()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: free pathgroups in group_by_prio()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: do not re-use retval in callout()

We've been abusing retval to hold the return value from dup,
and overwriting it later on.
Coverity doesn't like that.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: add missing checker description

Pointed out by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
kpartx: close filedescriptor on error

Pointed out by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: fixup possible NULL pointer access in allocate_binding()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: do not check for NULL parameter in extract_hwe_from_path()

Has already been checked, no need to be done here.

Signed-off-by: Hannes Reinecke <hare@suse.de>
kpartx: free up device name on error

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
kpartx: Free up strings obtained via strdup()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: free up alias on error

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: Fix resource leak in remove_features()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: fix resource leak in reassign_maps_handler()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: fix resource leak in read_value_block()

Pointed out by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd: fixup resource leak in configure()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: fixup resource leak in print_multipath_topology()

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath: avoid leaking of directory descriptors

Spotted by coverity.

Signed-off-by: Hannes Reinecke <hare@suse.de>