You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (dev->events) {
free(dev->events);
dev->events = NULL;
}
Since the dev->events is not assigned null, double free happens. The freeing of events should be defined inside the
mraa_gpio_isr_exit. Two places is not correct
The text was updated successfully, but these errors were encountered:
I think you're on to something, the call in mraa_gpio_close(...) should've been removed when c563e4f was merged. Initially the gpio_close and gpio_isr_exit functions were independent and managed by the user, so it did make sense to have both. Is this causing a segfault or any issues for your application?
Yes it is showing error for double free. After calling free we are not assigning null. So inside the gpio_isr_exit when it is checked again it assumes it not freed and does the free again.
The second issue is why we need this code in the close. The deleting of the events should be ideally inside the gpio_isr_exit.
In mraa_gpio_close(mraa_gpio_context dev)
mraa_gpio_isr_exit(dev);
In mraa_gpio_isr_exit(mraa_gpio_context dev)
Since the dev->events is not assigned null, double free happens. The freeing of events should be defined inside the
mraa_gpio_isr_exit. Two places is not correct
The text was updated successfully, but these errors were encountered: