summaryrefslogtreecommitdiff
path: root/memory/unix/apr_sms.c
diff options
context:
space:
mode:
authordreid <dreid@13f79535-47bb-0310-9956-ffa450edef68>2001-06-10 14:37:38 +0000
committerdreid <dreid@13f79535-47bb-0310-9956-ffa450edef68>2001-06-10 14:37:38 +0000
commit0b334a1776f196c17d6897bfbe27c6b4bbc14914 (patch)
treec3b5d0c66bc693965c9f314d960fc120ac993c4c /memory/unix/apr_sms.c
parent78aa373f89bca8ef5de4acbffc81bb3a48649273 (diff)
downloadlibapr-0b334a1776f196c17d6897bfbe27c6b4bbc14914.tar.gz
Fix the cleanup logic.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61741 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory/unix/apr_sms.c')
-rw-r--r--memory/unix/apr_sms.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/memory/unix/apr_sms.c b/memory/unix/apr_sms.c
index f3e2ed301..c8cd59a42 100644
--- a/memory/unix/apr_sms.c
+++ b/memory/unix/apr_sms.c
@@ -578,28 +578,26 @@ APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister(apr_sms_t *mem_sys,
cleanup = mem_sys->cleanups;
cleanup_ref = &mem_sys->cleanups;
while (cleanup) {
- if ((type == 0 || cleanup->cleanup_fn == cleanup_fn) &&
+ if ((type == 0 || cleanup->type == type) &&
cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
*cleanup_ref = cleanup->next;
- apr_lock_release(mem_sys->sms_lock);
-
mem_sys = mem_sys->accounting_mem_sys;
if (mem_sys->free_fn)
apr_sms_free(mem_sys, cleanup);
rv = APR_SUCCESS;
+ } else {
+ cleanup_ref = &cleanup->next;
+ cleanup = cleanup->next;
}
-
- cleanup_ref = &cleanup->next;
- cleanup = cleanup->next;
}
apr_lock_release(mem_sys->sms_lock);
/* The cleanup function must have been registered previously */
- return APR_EINVAL;
+ return rv;
}
APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys,