]> granicus.if.org Git - php/commitdiff
MFH
authorIlia Alshanetsky <iliaa@php.net>
Wed, 16 Apr 2003 01:07:20 +0000 (01:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 16 Apr 2003 01:07:20 +0000 (01:07 +0000)
ext/standard/string.c

index 366a34dd09c397c119ef48491dc3884a76e5a697..f7f98bb7b07742e1008564fe5e49f796da04d433 100644 (file)
@@ -4091,7 +4091,10 @@ PHP_FUNCTION(money_format) {
 
        str_len = format_len + 1024;
        str = emalloc(str_len);
-       str_len = strfmon(str, str_len, format, value);         
+       if ((str_len = strfmon(str, str_len, format, value)) < 0) {
+               efree(str);
+               RETURN_FALSE;
+       }
        str[str_len] = 0;
 
        RETURN_STRINGL(erealloc(str, str_len + 1), str_len, 0);