summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Kinder <nkinder@redhat.com>2010-09-09 08:25:23 -0700
committerNathan Kinder <nkinder@redhat.com>2010-09-09 13:40:36 -0700
commit660629d99dd270dc26472c10d3e9f7e2dea899b5 (patch)
tree38d3d4ce36da9aa163c9508127ecd79abb83eb01
parentedf42814c56604b083eb3cf244289ae1a6db9fdb (diff)
downloadds-660629d99dd270dc26472c10d3e9f7e2dea899b5.tar.gz
ds-660629d99dd270dc26472c10d3e9f7e2dea899b5.tar.xz
ds-660629d99dd270dc26472c10d3e9f7e2dea899b5.zip
Bug 630094 - (cov#15520) Fix unreachable code issue if perfctrs code
The final frees of priv->memory and priv will never be reached since the function returns prior to these calls. It looks as if an "error:" label was removed at some point, as the WIN32 code in this function has goto statements using that label, but the label is not defined. The fix is to add the "error:" label in ifdef blocks for WIN32 that calls the free of priv. The free of priv->memory is not necessary since WIN32 doesn't use it and non-WIN32 builds don't use the error label at all.
-rw-r--r--ldap/servers/slapd/back-ldbm/perfctrs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ldap/servers/slapd/back-ldbm/perfctrs.c b/ldap/servers/slapd/back-ldbm/perfctrs.c
index bb5ba00f..27efb7dd 100644
--- a/ldap/servers/slapd/back-ldbm/perfctrs.c
+++ b/ldap/servers/slapd/back-ldbm/perfctrs.c
@@ -211,10 +211,11 @@ void perfctrs_init(struct ldbminfo *li, perfctrs_private **ret_priv)
*ret_priv = priv;
return;
-#if !defined(_WIN32)
- if (priv) slapi_ch_free((void**)&priv->memory);
-#endif
+#if defined(_WIN32)
+error:
slapi_ch_free((void**)&priv);
+ return;
+#endif
}
/* Terminate perf ctrs */