commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] Created: (DAEMON-163) __apxMultiSzToJvmOptions has odd use of IS_INVALID_HANDLE
Date Tue, 04 May 2010 14:33:55 GMT
__apxMultiSzToJvmOptions has odd use of IS_INVALID_HANDLE
---------------------------------------------------------

                 Key: DAEMON-163
                 URL: https://issues.apache.org/jira/browse/DAEMON-163
             Project: Commons Daemon
          Issue Type: Bug
            Reporter: Sebb


__apxMultiSzToJvmOptions has odd use of IS_INVALID_HANDLE:

{code}
if (IS_INVALID_HANDLE(hPool))
    buff = apxPoolAlloc(hPool, (n + 1) * sizeof(JavaVMOption) + (l + 1));
else
    buff = apxAlloc((n + 1) * sizeof(JavaVMOption) + (l + 1));
{code}

The condition appears to be the wrong way round.

However, the method apxPoolAlloc also checks for IS_INVALID_HANDLE, and if true, the code
resolves to calling

__apxPoolAllocCore(_st_sys_pool, dwSize, 0)

which is exactly what apxAlloc() does. As far as I can tell, the hPool parameter is never
used here. 
If that is the intention, then just keep the code in the else part of the statement.
If not, then just keep the code in the if part of the statement.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message