cvs: php4 /ext/iconv iconv.c
| From: | Wez Furlong | Date: | Thu, 29 Mar 2001 09:37:09 +0000 |
| Subject: | cvs: php4 /ext/iconv iconv.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-4892@lists.php.net to get a copy of this message | ||
wez Thu Mar 29 01:37:09 2001 EDT
Modified files:
/php4/ext/iconv iconv.c
Log:
Fixed leak in php_iconv_string. Also returns FAILURE on failure,
rather than -1
Index: php4/ext/iconv/iconv.c
diff -u php4/ext/iconv/iconv.c:1.9 php4/ext/iconv/iconv.c:1.10
--- php4/ext/iconv/iconv.c:1.9 Thu Mar 15 12:45:49 2001
+++ php4/ext/iconv/iconv.c Thu Mar 29 01:37:09 2001
@@ -126,15 +126,15 @@
php_error(E_WARNING, "iconv: cannot convert from
%s' to %s'",
in_charset, out_charset);
efree(out_buffer);
- return -1;
+ return FAILURE;
}
result = icv(cd, (const char **) &in_p, &in_size, (char **)
&out_p, &out_size);
if (result == (size_t)(-1)) {
- sprintf(out_buffer, "???") ;
- return -1;
+ efree(out_buffer);
+ return FAILURE;
}
icv_close(cd);