1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-27 07:22:07 +03:00

storageBackendCreateQemuImgSecretPath: Use virSecureErase instead of VIR_DISPOSE_N

Clear out the value using virSecureErase and free it with g_free so
that VIR_DISPOSE_N can be phased out.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Peter Krempa 2021-02-01 14:13:53 +01:00
parent 91858434b4
commit 8bac46997f

View File

@ -74,6 +74,7 @@
#include "virxml.h"
#include "virfdstream.h"
#include "virutil.h"
#include "virsecureerase.h"
#define VIR_FROM_THIS VIR_FROM_STORAGE
@ -1314,7 +1315,8 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool,
cleanup:
virObjectUnref(conn);
VIR_DISPOSE_N(secret, secretlen);
virSecureErase(secret, secretlen);
g_free(secret);
return secretPath;