According to Coverity, there are two memory leaks in ipmi_sel_show_entry().
[...]
/* This isn't marked, but I believe it's leaking memory as well,
* because it's similar to the later, isn't it?
*/
sdr = ipmi_sdr_find_sdr_bynumtype(intf,
evt.sel_type.standard_type.gen_id,
evt.sel_type.standard_type.sensor_num,
evt.sel_type.standard_type.sensor_type);
[...]
/* This is being over-written constantly and Coverity doesn't like it.
* Also, malloc() is called in ipmi_sdr_find_sdr_byentity(), but no free().
*/
list = ipmi_sdr_find_sdr_byentity(intf, &entity);
And then there is issue with variable list not being free()-ed. I thought and still believe calling ipmi_sdr_list_empty() should fix memory leak, but it didn't satisfy Coverity. I haven't studied code thoroughly, but if I understand it correctly, only pointers are being returned and items(allocated memory) are kept/referenced in global SDR list. Therefore, ipmi_sdr_list_empty() should cover cleanup.
Any thoughts on this one, Jim?
On exit from ipmi_sel_show_entry() that is.
Jim?