libmultipath: fix null dereference int alloc_path_group
authorBenjamin Marzinski <bmarzins@redhat.com>
Tue, 9 Oct 2018 23:03:08 +0000 (18:03 -0500)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 10 Oct 2018 06:09:37 +0000 (08:09 +0200)
commit156b75082c7c5d5aa832e500cf4175c3f943fa22
treead89351472016ff53b399c0f327426f92e6c6ec8
parentc3b739527258dae7ebe4b5d083a33ce527675082
libmultipath: fix null dereference int alloc_path_group

If all_pathgroup failed to allocate a vector for pgp->paths, instead of
failing after it freed pgp, it would set pgp to NULL and then
dereference it. This patch fixes that. Found by coverity.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
libmultipath/structs.c