While setting up the event notifier group of a newly registered
application (see `ust_app_setup_event_notifier_group()`), communications
with the application can fail (generally because the application exited)
while sending the error counter configuration. This causes the UST
handle to the event notifier group to be released.
However, a second release is performed which results in undefined
behaviour (I have seen it succeed, assert, and crash under different
circumstances) while disposing of the application (see
`delete_ust_app()`).
Set the event notifier group ust handle to NULL to mark it as invalid
and prevent a second release during the clean-up.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia5623a8d3f57174effa51c278e9654b6adc43289
error:
ustctl_release_object(app->sock, app->event_notifier_group.object);
free(app->event_notifier_group.object);
+ app->event_notifier_group.object = NULL;
return ret;
}