From 171fc4de91d19f4ba6e642f4aa9585de1b6c3ef8 Mon Sep 17 00:00:00 2001 From: opa334 Date: Tue, 7 May 2024 01:37:47 +0200 Subject: [PATCH] This should be better --- BaseBin/launchdhook/src/jbserver/jbdomain_systemwide.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/BaseBin/launchdhook/src/jbserver/jbdomain_systemwide.c b/BaseBin/launchdhook/src/jbserver/jbdomain_systemwide.c index 5a700655c..14b1bbb28 100644 --- a/BaseBin/launchdhook/src/jbserver/jbdomain_systemwide.c +++ b/BaseBin/launchdhook/src/jbserver/jbdomain_systemwide.c @@ -138,7 +138,11 @@ static int systemwide_process_checkin(audit_token_t *processToken, char **rootPa }; int sandboxExtensionsCount = sizeof(sandboxExtensionsArr) / sizeof(char *); *sandboxExtensionsOut = combine_strings('|', sandboxExtensionsArr, sandboxExtensionsCount); - for (int i = 0; i < sandboxExtensionsCount; i++) free(sandboxExtensionsArr[i]); + for (int i = 0; i < sandboxExtensionsCount; i++) { + if (sandboxExtensionsArr[i]) { + free(sandboxExtensionsArr[i]); + } + } bool fullyDebugged = false; if (stringStartsWith(procPath, "/private/var/containers/Bundle/Application") || stringStartsWith(procPath, JBRootPath("/Applications"))) {