diff options
author | David Eriksson <eriksson@php.net> | 2001-02-20 15:18:27 +0000 |
---|---|---|
committer | David Eriksson <eriksson@php.net> | 2001-02-20 15:18:27 +0000 |
commit | fd4f4729287b7c83ddc29b9f16d3821d85c52402 (patch) | |
tree | d6263d71a1751aabf87cb63cfd38577f7f817614 /ext/satellite | |
parent | 1ed938cebad7d3453b7968f2a5ff49dfa251798e (diff) | |
download | php-git-fd4f4729287b7c83ddc29b9f16d3821d85c52402.tar.gz |
Stop leaking ParameterType data
Diffstat (limited to 'ext/satellite')
-rw-r--r-- | ext/satellite/object.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/ext/satellite/object.c b/ext/satellite/object.c index 6e322bb41d..e4732f2737 100644 --- a/ext/satellite/object.c +++ b/ext/satellite/object.c @@ -391,13 +391,18 @@ static zend_bool OrbitObject_AddArguments(OrbitObject * pObject, CORBA_Request request, OperationType * pOperation, int argumentCount, const zval ** ppArguments, CORBA_NamedValue ** ppNamedValue) { - ParameterType * p_parameter = OperationType_GetFirstParameter(pOperation); + ParameterType * p_parameter = NULL; int i = 0; - zend_bool success; + zend_bool success = FALSE; if (argumentCount < 1) return TRUE; /* nothing to do */ + p_parameter = OperationType_GetFirstParameter(pOperation); + + if (NULL == p_parameter) + return FALSE; /* oups! */ + do { ppNamedValue[i] = satellite_new(CORBA_NamedValue); @@ -405,7 +410,7 @@ static zend_bool OrbitObject_AddArguments(OrbitObject * pObject, request, p_parameter, ppArguments[i], ppNamedValue[i]); if (!success) - return FALSE; + goto error; i++; } while (i < argumentCount && ParameterType_GetNext(p_parameter)); @@ -417,10 +422,19 @@ static zend_bool OrbitObject_AddArguments(OrbitObject * pObject, /* bad number of arguments */ wrong_param_count(); - return FALSE; + goto error; } - return TRUE; + success = TRUE; + goto exit; + +error: + success = FALSE; + +exit: + orbit_delete(p_parameter); + return success; + } /* |