From 93bcd55eafbcf2a49e8963c3475d5a7b1fbc8c53 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 12 Aug 2003 00:58:52 +0000 Subject: emalloc -> safe_emalloc --- ext/xml/xml.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/xml/xml.c') diff --git a/ext/xml/xml.c b/ext/xml/xml.c index ef6f762ea4..210d25648d 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -408,7 +408,7 @@ static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function * int result; zend_fcall_info fci; - args = emalloc(sizeof(zval **) * argc); + args = safe_emalloc(sizeof(zval **), argc, 0); for (i = 0; i < argc; i++) { args[i] = &argv[i]; } @@ -525,7 +525,7 @@ static XML_Char *xml_utf8_encode(const char *s, int len, int *newlen, const XML_ } /* This is the theoretical max (will never get beyond len * 2 as long * as we are converting from single-byte characters, though) */ - newbuf = emalloc(len * 4 + 1); + newbuf = safe_emalloc(len, 4, 1); while (pos > 0) { c = encoder ? encoder((unsigned char)(*s)) : (unsigned short)(*s); if (c < 0x80) { @@ -1368,7 +1368,7 @@ PHP_FUNCTION(xml_parse_into_struct) if (info) parser->info = *info; parser->level = 0; - parser->ltags = emalloc(XML_MAXLEVEL * sizeof(char *)); + parser->ltags = safe_emalloc(XML_MAXLEVEL, sizeof(char *), 0); XML_SetDefaultHandler(parser->parser, _xml_defaultHandler); XML_SetElementHandler(parser->parser, _xml_startElementHandler, _xml_endElementHandler); -- cgit v1.2.1