aboutsummaryrefslogtreecommitdiff
path: root/src/macosx/native/java/util/SCDynamicStoreConfig.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/macosx/native/java/util/SCDynamicStoreConfig.m')
-rw-r--r--src/macosx/native/java/util/SCDynamicStoreConfig.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/macosx/native/java/util/SCDynamicStoreConfig.m b/src/macosx/native/java/util/SCDynamicStoreConfig.m
index d3f838871a..4ea43635d4 100644
--- a/src/macosx/native/java/util/SCDynamicStoreConfig.m
+++ b/src/macosx/native/java/util/SCDynamicStoreConfig.m
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -102,7 +102,8 @@ NSDictionary *realmConfigsForRealms(SCDynamicStoreRef store, NSArray *realms) {
for (NSString *realm in realms) {
CFTypeRef realmInfo = SCDynamicStoreCopyValue(store, (CFStringRef) [NSString stringWithFormat:@"Kerberos:%@", realm]);
- if (CFGetTypeID(realmInfo) != CFDictionaryGetTypeID()) {
+ if (realmInfo == NULL || CFGetTypeID(realmInfo) != CFDictionaryGetTypeID()) {
+ if (realmInfo) CFRelease(realmInfo);
return nil;
}