mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
conf: clean up memory containing secrets before freeing
The password may not be valid in the error branch, but for higher security, it's better to clean up the memory before freeing it. Signed-off-by: jiangjiacheng <jiangjiacheng@huawei.com> Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
This commit is contained in:
parent
2ce45ddea3
commit
51f8130d78
@ -60,6 +60,7 @@
|
||||
#include "virdomainsnapshotobjlist.h"
|
||||
#include "virdomaincheckpointobjlist.h"
|
||||
#include "virutil.h"
|
||||
#include "virsecureerase.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_DOMAIN
|
||||
|
||||
@ -10849,6 +10850,7 @@ virDomainGraphicsAuthDefParseXML(xmlNodePtr node,
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("cannot parse password validity time '%s', expect YYYY-MM-DDTHH:MM:SS"),
|
||||
validTo);
|
||||
virSecureEraseString(def->passwd);
|
||||
VIR_FREE(def->passwd);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user