From 689d5bae95055025b59997ad238d2f4bc0a9a168 Mon Sep 17 00:00:00 2001 From: Felix Kratz Date: Mon, 14 Feb 2022 09:46:22 +0100 Subject: [PATCH] properly release role_ref --- src/ax.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }