Skip to content

Removes uninitialized variable in function __CFMessagePortCreateRemote in CFMessagePort #2811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions CoreFoundation/RunLoop.subproj/CFMessagePort.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,7 @@ static CFMessagePortRef __CFMessagePortCreateRemote(CFAllocatorRef allocator, CF
CFMachPortContext ctx;
uint8_t *utfname = NULL;
CFIndex size;
mach_port_t port;
kern_return_t ret;
mach_port_t port = MACH_PORT_NULL;

CFStringRef const name = __CFMessagePortCreateSanitizedStringName(inName, &utfname, NULL);
if (NULL == name) {
Expand Down Expand Up @@ -489,7 +488,7 @@ static CFMessagePortRef __CFMessagePortCreateRemote(CFAllocatorRef allocator, CF
ctx.retain = NULL;
ctx.release = NULL;
ctx.copyDescription = NULL;
native = (KERN_SUCCESS == ret) ? CFMachPortCreateWithPort(allocator, port, __CFMessagePortDummyCallback, &ctx, NULL) : NULL;
native = CFMachPortCreateWithPort(allocator, port, __CFMessagePortDummyCallback, &ctx, NULL);
CFAllocatorDeallocate(kCFAllocatorSystemDefault, utfname);
if (NULL == native) {
// name is released by deallocation
Expand Down