summaryrefslogtreecommitdiffstats
path: root/ldap/servers/slapd
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2010-07-01 23:28:57 -0500
committerNoriko Hosoi <nhosoi@redhat.com>2010-08-23 11:02:17 -0700
commit102b24925ad9dc820f19fa58d1c74f4672cc79d1 (patch)
tree5441d55cdf5b81ca1af0c5a5233d7b1aa3185469 /ldap/servers/slapd
parentba8134132fe2d9ed62b990c781b51beff680ada2 (diff)
downloadds-102b24925ad9dc820f19fa58d1c74f4672cc79d1.tar.gz
ds-102b24925ad9dc820f19fa58d1c74f4672cc79d1.tar.xz
ds-102b24925ad9dc820f19fa58d1c74f4672cc79d1.zip
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
https://bugzilla.redhat.com/show_bug.cgi?id=610119 Resolves: bug 610119 Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199 Fix description: Catch possible NULL pointer in import_grok_db_stats().
Diffstat (limited to 'ldap/servers/slapd')
-rw-r--r--ldap/servers/slapd/back-ldbm/import.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ldap/servers/slapd/back-ldbm/import.c b/ldap/servers/slapd/back-ldbm/import.c
index 8e6e2882..302e65a5 100644
--- a/ldap/servers/slapd/back-ldbm/import.c
+++ b/ldap/servers/slapd/back-ldbm/import.c
@@ -521,6 +521,10 @@ static double import_grok_db_stats(ldbm_instance *inst)
return_value = dblayer_memp_stat_instance(inst, &mpstat, &mpfstat);
+ if (!mpstat) {
+ goto out;
+ }
+
if (0 == return_value) {
unsigned long current_cache_hits = mpstat->st_cache_hit;
unsigned long current_cache_misses = mpstat->st_cache_miss;
@@ -537,7 +541,9 @@ static double import_grok_db_stats(ldbm_instance *inst)
}
inst->inst_cache_misses = current_cache_misses;
inst->inst_cache_hits = current_cache_hits;
+ }
+out:
if (mpstat)
slapi_ch_free((void **)&mpstat);
if (mpfstat) {
@@ -549,7 +555,6 @@ static double import_grok_db_stats(ldbm_instance *inst)
#endif
slapi_ch_free((void **)&mpfstat);
}
- }
return cache_hit_ratio;
}