Skip to content

Commit 3cf6ce3

Browse files
authored
Merge pull request #2899 from valeriyvan/leak_CFURL
2 parents ab6a345 + a41a1df commit 3cf6ce3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CoreFoundation/URL.subproj/CFURL.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4786,7 +4786,7 @@ CFURLRef CFURLCreateCopyAppendingPathComponent(CFAllocatorRef allocator, CFURLRe
47864786
#endif
47874787

47884788
CFMutableStringRef newString;
4789-
CFStringRef newComp;
4789+
CFStringRef newComp = NULL;
47904790
CFRange pathRg;
47914791
if (!(url->_flags & HAS_PATH)) {
47924792
result = NULL;
@@ -4815,9 +4815,9 @@ CFURLRef CFURLCreateCopyAppendingPathComponent(CFAllocatorRef allocator, CFURLRe
48154815
if (isDirectory) {
48164816
CFStringInsert(newString, pathRg.location + pathRg.length + CFStringGetLength(newComp), CFSTR("/"));
48174817
}
4818-
CFRelease(newComp);
48194818
result = _CFURLCreateWithArbitraryString(allocator, newString, url->_base);
48204819
}
4820+
if (newComp) CFRelease(newComp);
48214821
CFRelease(newString);
48224822
}
48234823
}

0 commit comments

Comments
 (0)