summaryrefslogtreecommitdiffstats
path: root/daemons/ipa-slapi-plugins/ipa-sidgen
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-10-02 11:25:04 +0200
committerMartin Kosek <mkosek@redhat.com>2012-10-17 14:32:37 +0200
commitc1b922352fd88909401bad914cf660f29d5b063c (patch)
tree76c8095e74ef5deaa8715938801ae85ee15324eb /daemons/ipa-slapi-plugins/ipa-sidgen
parent2d42737d018ac09253f73c89a90f21dddce4fc6c (diff)
downloadfreeipa-c1b922352fd88909401bad914cf660f29d5b063c.tar.gz
freeipa-c1b922352fd88909401bad914cf660f29d5b063c.tar.xz
freeipa-c1b922352fd88909401bad914cf660f29d5b063c.zip
Fix various issues found by Coverity
Diffstat (limited to 'daemons/ipa-slapi-plugins/ipa-sidgen')
-rw-r--r--daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c
index ffbc9c636..9e474e83d 100644
--- a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c
+++ b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c
@@ -71,7 +71,10 @@ static const char *fetch_attr(Slapi_Entry *e, const char *attrname,
if (slapi_entry_attr_find(e, attrname, &attr) != 0)
return default_val;
- slapi_attr_first_value(attr, &val);
+
+ if (slapi_attr_first_value(attr, &val) == -1)
+ return default_val;
+
return slapi_value_get_string(val);
}