summaryrefslogtreecommitdiff
path: root/ext/xmlrpc/libxmlrpc/encodings.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/xmlrpc/libxmlrpc/encodings.c')
-rw-r--r--ext/xmlrpc/libxmlrpc/encodings.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/ext/xmlrpc/libxmlrpc/encodings.c b/ext/xmlrpc/libxmlrpc/encodings.c
index 081e38e5de..5777152ea8 100644
--- a/ext/xmlrpc/libxmlrpc/encodings.c
+++ b/ext/xmlrpc/libxmlrpc/encodings.c
@@ -30,16 +30,7 @@
*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifndef PHP_WIN32
-#include <php_config.h>
-#else
-#include <config.w32.h>
-#include <stdlib.h>
-#endif
+#include <php.h>
static const char rcsid[] = "#(@) $Id$";
@@ -74,7 +65,7 @@ static char* convert(const char* src, int src_len, int *new_len, const char* fro
ic = iconv_open(to_enc, from_enc);
if(ic != (iconv_t)-1) {
size_t st;
- outbuf = (char*)malloc(outlen + 1);
+ outbuf = (char*)emalloc(outlen + 1);
if(outbuf) {
out_ptr = (char*)outbuf;
@@ -85,14 +76,14 @@ static char* convert(const char* src, int src_len, int *new_len, const char* fro
int diff = out_ptr - outbuf;
outlen += inlenleft;
outlenleft += inlenleft;
- outbuf = (char*)realloc(outbuf, outlen + 1);
+ outbuf = (char*)erealloc(outbuf, outlen + 1);
if(!outbuf) {
break;
}
out_ptr = outbuf + diff;
}
else {
- free(outbuf);
+ efree(outbuf);
outbuf = 0;
break;
}