openhpi2 / openhpi_bug_test

0 stars 0 forks source link

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

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