crypto: Fix memory leaks in set_loaded for tls-*
commitab366aae78bcac972a0920ffdda3136fc13fa093
authorKevin Wolf <kwolf@redhat.com>
Mon, 30 Nov 2020 10:56:14 +0000 (30 11:56 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 29 Jan 2021 17:07:53 +0000 (29 17:07 +0000)
treed047381b8fe8f2b1bdf823b3aa4f604e75e91029
parent668cb74b2af1129349a6c41763bc88d801161e09
crypto: Fix memory leaks in set_loaded for tls-*

If you set the loaded property to true when it was already true, the
state is overwritten without freeing the old state first. Change the
set_loaded callback so that it always frees the old state (which is a
no-op if nothing was loaded) and only then load if requestsd.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
crypto/tlscredsanon.c
crypto/tlscredspsk.c
crypto/tlscredsx509.c