hs20-osu-client: Ensure NULL checks are done before dereferencing

In some error cases, pointers were dereferenced before NULL check is
done. Fix this by adding checks before the dereference.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Change-Id: Iabebe2c6426bcdfc8b3eaeae1bae1372b54787e4
Git-commit: 715d5c45f13a79c46544753b4046fc17e2c3062d
Git-repo: git://w1.fi/srv/git/hostap.git
CRs-Fixed: 799051
2 files changed