Fabio M. Di Nitto wrote:
>> @@ -150,6 +162,10 @@ void corosync_request_shutdown (void)
>>         poll_stop (0);
>>         totempg_finalize ();
>>         coroipcs_ipc_exit ();
>> +
>> +       /*Remove uidgid_list*/
>> +       corosync_remove_uidgid_list ();
>
> Is there really a need to free this list on exit? we are about to abort
> anyway and the kernel will take care of that.
>
>> +
>>         corosync_exit_error (AIS_DONE_EXIT);
>>  }

"need", maybe not.
But it is generally good to explicitly free otherwise-leaked memory,
even just before exit.

The benefit comes when you use a tool like valgrind to find leaks.
With the explicit free, no leak is reported here.
If you remove the free, valgrind reports the leak
and you or multiple people will have to go investigate it.
Perhaps multiple times.

This becomes especially relevant only once you have
enough of a regression test suite to exercise such code paths.
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to