diff --git a/src/ax.c b/src/ax.c index 6163796..0edcc8b 100644 --- a/src/ax.c +++ b/src/ax.c @@ -151,8 +151,9 @@ bool ax_get_selected_element(struct ax* ax) { // free(role); } + if (role_ref) CFRelease(role_ref); + if (!role) { - if (role_ref) CFRelease(role_ref); CFRelease(selected_element); selected_element = NULL; }