From b4880a260edd0902e1f3ea65ee061461eb7d8440 Mon Sep 17 00:00:00 2001 From: Thomas A Date: Mon, 30 May 2022 17:05:16 -0700 Subject: [PATCH] Only call release if message is not NULL For some reason, launchd seems to stall when `[message release]` is called when message is NULL. This only seems to be an issue with the newer source. The older source doesn't require this check. I'm worried that I might be overlooking an underlying issue... --- src/pipe.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipe.m b/src/pipe.m index 0b06fbd..d04fb98 100644 --- a/src/pipe.m +++ b/src/pipe.m @@ -165,7 +165,7 @@ XPC_CLASS_HEADER(pipe); mach_msg_return_t ret = MACH_MSG_SUCCESS; retry: - [message release]; + if (message != NULL) { [message release]; } message = dispatch_mach_msg_create(NULL, messageSize, DISPATCH_MACH_MSG_DESTRUCTOR_DEFAULT, &header); if (!message) { status = ENOMEM;