add cleanup function to clear sdr cache,

zero password field when setting
This commit is contained in:
Duncan Laurie 2004-11-17 23:27:13 +00:00
parent 2e1f1ef750
commit 1a34cc960e

View File

@ -150,6 +150,7 @@ void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password)
intf->session->password = 0;
if (password) {
intf->session->password = 1;
memset(intf->session->authcode, 0, IPMI_AUTHCODE_BUFFER_SIZE);
memcpy(intf->session->authcode,
password,
min(strlen(password), IPMI_AUTHCODE_BUFFER_SIZE));
@ -174,3 +175,8 @@ void ipmi_intf_session_set_authtype(struct ipmi_intf * intf, unsigned char autht
if (intf && intf->session)
intf->session->authtype_set = authtype;
}
void ipmi_cleanup(struct ipmi_intf * intf)
{
ipmi_sdr_list_empty(intf);
}