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>
#include "virdomainsnapshotobjlist.h"
#include "virdomaincheckpointobjlist.h"
#include "virutil.h"
+#include "virsecureerase.h"
#define VIR_FROM_THIS VIR_FROM_DOMAIN
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;
}