/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
"Error converting first argument to UTF-16", 0 TSRMLS_CC );
- efree( ustr1 );
+ if (ustr1) {
+ efree( ustr1 );
+ }
RETURN_FALSE;
}
/* Set error messages. */
intl_errors_set_custom_msg( COLLATOR_ERROR_P( co ),
"Error converting second argument to UTF-16", 0 TSRMLS_CC );
- efree( ustr1 );
- efree( ustr2 );
+ if (ustr1) {
+ efree( ustr1 );
+ }
+ if (ustr2) {
+ efree( ustr2 );
+ }
RETURN_FALSE;
}
udat_applyPattern(DATE_FORMAT_OBJECT(dfo), (UBool)is_pattern_localized, svalue, slength);
- efree(svalue);
+ if (svalue) {
+ efree(svalue);
+ }
INTL_METHOD_CHECK_STATUS(dfo, "Error setting symbol value");
RETURN_TRUE;
/* Actually set new attribute value. */
unum_setTextAttribute(FORMATTER_OBJECT(nfo), attribute, svalue, slength, &INTL_DATA_ERROR_CODE(nfo));
- efree(svalue);
+ if (svalue) {
+ efree(svalue);
+ }
INTL_METHOD_CHECK_STATUS( nfo, "Error setting text attribute" );
RETURN_TRUE;
/* Actually set the symbol. */
unum_setSymbol(FORMATTER_OBJECT(nfo), symbol, svalue, slength, &INTL_DATA_ERROR_CODE(nfo));
- efree(svalue);
+ if (svalue) {
+ efree(svalue);
+ }
INTL_METHOD_CHECK_STATUS( nfo, "Error setting symbol value" );
RETURN_TRUE;
/* TODO: add parse error information */
unum_applyPattern(FORMATTER_OBJECT(nfo), 0, svalue, slength, NULL, &INTL_DATA_ERROR_CODE(nfo));
- efree(svalue);
+ if (svalue) {
+ efree(svalue);
+ }
INTL_METHOD_CHECK_STATUS( nfo, "Error setting pattern value" );
RETURN_TRUE;
ZVAL_LONG(zposition, position);
}
- efree(sstr);
+ if (sstr) {
+ efree(sstr);
+ }
INTL_METHOD_CHECK_STATUS( nfo, "Number parsing failed" );
}
zval_dtor(zposition);
ZVAL_LONG(zposition, position);
}
- efree(sstr);
+ if (sstr) {
+ efree(sstr);
+ }
INTL_METHOD_CHECK_STATUS( nfo, "Number parsing failed" );
/* Convert parsed currency to UTF-8 and pass it back to caller. */
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree( ustring );
+ if (ustring) {
+ efree( ustring );
+ }
RETURN_NULL();
}
ret_len = grapheme_split_string(ustring, ustring_len, NULL, 0 TSRMLS_CC );
- efree( ustring );
+ if (ustring) {
+ efree( ustring );
+ }
if (ret_len >= 0) {
RETVAL_LONG(ret_len);
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree( ustr );
+ if (ustr) {
+ efree( ustr );
+ }
RETURN_FALSE;
}
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_substr: start not contained in string", 1 TSRMLS_CC );
- efree(ustr);
+ if (ustr) {
+ efree(ustr);
+ }
ubrk_close(bi);
RETURN_FALSE;
}
status = U_ZERO_ERROR;
intl_convert_utf16_to_utf8((char **)&sub_str, &sub_str_len, ustr + sub_str_start_pos, ustr_len - sub_str_start_pos, &status);
- efree( ustr );
+ if (ustr) {
+ efree( ustr );
+ }
ubrk_close( bi );
if ( U_FAILURE( status ) ) {
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting output string to UTF-8", 0 TSRMLS_CC );
+
efree( sub_str );
RETURN_FALSE;
ret_pos = (*grapheme_extract_iters[extract_type])(bi, size, pstr, str_len);
- efree(ustr);
+ if (ustr) {
+ efree(ustr);
+ }
ubrk_close(bi);
if ( NULL != next ) {
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree( uhaystack );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
return -1;
}
if ( NULL == puhaystack ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
- efree( uhaystack );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
ubrk_close (bi);
return -1;
}
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree( uhaystack );
- efree( uneedle );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
+ if (uneedle) {
+ efree( uneedle );
+ }
ubrk_close (bi);
return -1;
}
}
exit:
- efree( uhaystack );
- efree( uneedle );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
+ if (uneedle) {
+ efree( uneedle );
+ }
ubrk_close (bi);
return ret_pos;
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree( uhaystack );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
return -1;
}
if ( NULL == puhaystack ) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "grapheme_strpos: Offset not contained in string", 1 TSRMLS_CC );
-
- efree( uhaystack );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
ubrk_close (bi);
return -1;
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree( uhaystack );
- efree( uneedle );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
+ if (uneedle) {
+ efree( uneedle );
+ }
ubrk_close (bi);
return -1;
*puchar_pos = ubrk_current(bi);
- efree( uhaystack );
- efree( uneedle );
+ if (uhaystack) {
+ efree( uhaystack );
+ }
+ if (uneedle) {
+ efree( uneedle );
+ }
ubrk_close (bi);
return ret_pos;
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree(ustring);
+ if (ustring) {
+ efree(ustring);
+ }
RETURN_FALSE;
} else {
UParseError parse_error;
/* TODO: add parse error information */
umsg_applyPattern(MSG_FORMAT_OBJECT(mfo), spattern, spattern_len, NULL, &INTL_DATA_ERROR_CODE(mfo));
- efree(spattern);
+ if (spattern) {
+ efree(spattern);
+ }
INTL_METHOD_CHECK_STATUS(mfo, "Error setting symbol value");
if(mfo->mf_data.orig_format) {
INTL_METHOD_CHECK_STATUS(mfo, "Converting parse string failed");
umsg_parse_helper(MSG_FORMAT_OBJECT(mfo), &count, &fargs, usource, usrc_len, &INTL_DATA_ERROR_CODE(mfo));
- efree(usource);
+ if (usource) {
+ efree(usource);
+ }
INTL_METHOD_CHECK_STATUS(mfo, "Parsing failed");
array_init(return_value);
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting input string to UTF-16", 0 TSRMLS_CC );
- efree( uinput );
+ if (uinput) {
+ efree( uinput );
+ }
RETURN_FALSE;
}
/* Set error messages. */
intl_error_set_custom_msg( NULL, "Error converting string to UTF-16.", 0 TSRMLS_CC );
- efree( uinput );
+ if (uinput) {
+ efree( uinput );
+ }
RETURN_FALSE;
}