Error reporting leaks and cleanup

This commit is contained in:
Wez Furlong 2003-02-10 12:33:15 +00:00
parent 778ce2495d
commit b0894e7eba
2 changed files with 6 additions and 8 deletions

View file

@ -495,7 +495,7 @@ static int com_call(rpc_string method_name, void **data, zval *return_value, int
VARIANT *variant_args;
VARIANT result;
int current_arg, current_variant;
char *ErrString;
char *ErrString = NULL;
TSRMLS_FETCH();
/* if the length of the name is 0, we are dealing with a pointer to a dispid */
@ -552,7 +552,7 @@ static int com_call(rpc_string method_name, void **data, zval *return_value, int
static int com_get(rpc_string property_name, zval *return_value, void **data)
{
char *ErrString;
char *ErrString = NULL;
VARIANT *result;
OLECHAR *propname;
DISPID dispid;
@ -610,7 +610,7 @@ static int com_set(rpc_string property_name, zval *value, void **data)
DISPID dispid, mydispid = DISPID_PROPERTYPUT;
DISPPARAMS dispparams;
VARIANT *var;
char *error_message, *ErrString;
char *error_message, *ErrString = NULL;
TSRMLS_FETCH();
/* obtain property handler */

View file

@ -125,8 +125,7 @@ ZEND_API HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, D
SysFreeString(ExceptInfo.bstrDescription);
}
*ErrString = emalloc(srclen+desclen+50);
zend_sprintf(*ErrString, "<b>Source</b>: %s <b>Description</b>: %s", src, desc);
spprintf(ErrString, 0, "<b>Source</b>: %s <b>Description</b>: %s", src, desc);
efree(src);
efree(desc);
@ -138,8 +137,7 @@ ZEND_API HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, D
break;
case DISP_E_PARAMNOTFOUND:
case DISP_E_TYPEMISMATCH:
*ErrString = emalloc(25);
sprintf(*ErrString, "<b>Argument</b>: %d", pDispParams->cArgs-ArgErr+1);
spprintf(ErrString, 0, "<b>Argument</b>: %d", pDispParams->cArgs-ArgErr+1);
break;
}
}
@ -247,7 +245,7 @@ ZEND_API HRESULT php_COM_set(comval *obj, IDispatch FAR* FAR* ppDisp, int cleanu
ZEND_API char *php_COM_error_message(HRESULT hr)
{
void *pMsgBuf;
void *pMsgBuf = NULL;
if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL,
hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pMsgBuf, 0, NULL)) {