repair memory leak on sent packets

This commit is contained in:
Duncan Laurie 2004-03-08 20:31:26 +00:00
parent 9c87f801a4
commit 572f2df8bb

View File

@ -157,6 +157,8 @@ ipmi_req_remove_entry(unsigned char seq, unsigned char cmd)
else
ipmi_req_entries_tail = NULL;
}
if (e->msg_data)
free(e->msg_data);
free(e);
}
}
@ -666,7 +668,6 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
while (try < IPMI_LAN_RETRY) {
if (ipmi_lan_send_packet(intf, entry->msg_data, entry->msg_len) < 0) {
printf("ipmi_lan_send_cmd failed\n");
free(entry->msg_data);
return NULL;
}
@ -683,9 +684,6 @@ ipmi_lan_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
try++;
}
free(entry->msg_data);
entry->msg_len = 0;
return rsp;
}