openhpi2 / Open-HPI

Open HPI is an open source implementation of the SA Forum's Hardware Platform Interface (HPI). HPI provides an abstracted interface to managing computer hardware, typically for chassis and rack based servers
Other
3 stars 1 forks source link

Create wrap_g_free to set the freed memory to NULL in ilo2_ribcl plugin #2564

Closed openhpi2 closed 8 years ago

openhpi2 commented 9 years ago

g_free call does not set the pointer to NULL after freeing the memory at some places in ilo2_ribcl plugin. This can lead to potential core dumps. Create a wrapper function to g_free which will free the memory and set the pointer to NULL.

Also g_malloc0 initializes the contents to 0 after allocating it. Replace g_malloc to g_malloc0 in ilo2_ribcl plugin.

Reported by: openhpi2

openhpi2 commented 9 years ago

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Fixed with checkin #7612

Original comment by: dr_mohan

openhpi2 commented 9 years ago

Praveen supplied the patch to fix the defect

Original comment by: dr_mohan