apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@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 08:37:04 GMT


On 05/28/2008 08:10 AM, Nick Kew wrote:
> 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?

IMHO yes. We can save a non APR_SUCCESS return value and return it
at the end.

Regards

RĂ¼diger

Mime
View raw message