apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <...@apache.org>
Subject Re: DO NOT REPLY [Bug 45086] New: (reslist_cleanup.c) A potential bug discovered by a static program analysis approach
Date Wed, 28 May 2008 06:10:07 GMT
On Tue, 27 May 2008, bugzilla@apache.org wrote:

> File Name: /srclib/apr-util/misc/apr_reslist.c
> Function Name: reslist_cleanup()
> Buggy Code:
>
>   144:     apr_thread_mutex_lock(rl->listlock);
>   145:
>   146:     while (rl->nidle > 0) {
>   147:         res = pop_resource(rl);
>   148:         rl->ntotal--;
>   149:         rv = destroy_resource(rl, res);
>   150:         if (rv != APR_SUCCESS)
>   151:             return rv;
>             // the execution of apr_thread_mutex_unlock() is missed.

That return looks like a relatively serious issue.  Shouldn't
the cleanup plough on and destroy_resource on every resource
(i.e. while ntotal > 0) regardless in that loop?

-- 
Nick Kew

Mime
View raw message