Skip to content

Commit 70ac8ed

Browse files
authored
Merge pull request #2811 from valeriyvan/CFMessagePort
2 parents 28cf060 + 035561e commit 70ac8ed

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CoreFoundation/RunLoop.subproj/CFMessagePort.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ static CFMessagePortRef __CFMessagePortCreateRemote(CFAllocatorRef allocator, CF
443443
CFMachPortContext ctx;
444444
uint8_t *utfname = NULL;
445445
CFIndex size;
446-
mach_port_t port;
447-
kern_return_t ret;
446+
mach_port_t port = MACH_PORT_NULL;
448447

449448
CFStringRef const name = __CFMessagePortCreateSanitizedStringName(inName, &utfname, NULL);
450449
if (NULL == name) {
@@ -489,7 +488,7 @@ static CFMessagePortRef __CFMessagePortCreateRemote(CFAllocatorRef allocator, CF
489488
ctx.retain = NULL;
490489
ctx.release = NULL;
491490
ctx.copyDescription = NULL;
492-
native = (KERN_SUCCESS == ret) ? CFMachPortCreateWithPort(allocator, port, __CFMessagePortDummyCallback, &ctx, NULL) : NULL;
491+
native = CFMachPortCreateWithPort(allocator, port, __CFMessagePortDummyCallback, &ctx, NULL);
493492
CFAllocatorDeallocate(kCFAllocatorSystemDefault, utfname);
494493
if (NULL == native) {
495494
// name is released by deallocation

0 commit comments

Comments
 (0)