summaryrefslogtreecommitdiffstats
path: root/daemons/ipa-slapi-plugins
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2013-08-27 17:34:46 -0400
committerPetr Viktorin <pviktori@redhat.com>2013-08-29 15:26:46 +0200
commit3940a574f95750e6bd02dcc30953db0fe9146f0a (patch)
tree17cf8dbf56a78918aa0885a76b0a182146268812 /daemons/ipa-slapi-plugins
parentf742520760d1b146cd3c5e79a6c86a024570ff6a (diff)
downloadfreeipa-3940a574f95750e6bd02dcc30953db0fe9146f0a.tar.gz
freeipa-3940a574f95750e6bd02dcc30953db0fe9146f0a.tar.xz
freeipa-3940a574f95750e6bd02dcc30953db0fe9146f0a.zip
Re-order NULL check in ipa_lockout.
There is no risk of crash here as slapi_valueset_first_value() can handle the case where the valueset is NULL, but there is no point in calling that if we know there are no values. https://fedorahosted.org/freeipa/ticket/3880
Diffstat (limited to 'daemons/ipa-slapi-plugins')
-rw-r--r--daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c b/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c
index 9e903aaf1..fd6602fde 100644
--- a/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c
+++ b/daemons/ipa-slapi-plugins/ipa-lockout/ipa_lockout.c
@@ -244,9 +244,8 @@ int ipalockout_getpolicy(Slapi_Entry *target_entry, Slapi_Entry **policy_entry,
if (ldrc == 0) {
Slapi_Value *sv = NULL;
- slapi_valueset_first_value(*values, &sv);
-
if (values != NULL) {
+ slapi_valueset_first_value(*values, &sv);
*policy_dn = slapi_value_get_string(sv);
}
}