From 2d42310d66a2108d1f0c68ee34bf4f356c4e5aac Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 10 Jul 2007 11:07:56 +0000 Subject: use safe_emalloc() --- ext/bcmath/libbcmath/src/num2str.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/bcmath/libbcmath/src/num2str.c') diff --git a/ext/bcmath/libbcmath/src/num2str.c b/ext/bcmath/libbcmath/src/num2str.c index c47ec9bbad..14c57726fe 100644 --- a/ext/bcmath/libbcmath/src/num2str.c +++ b/ext/bcmath/libbcmath/src/num2str.c @@ -51,9 +51,9 @@ char /* Allocate the string memory. */ signch = ( num->n_sign == PLUS ? 0 : 1 ); /* Number of sign chars. */ if (num->n_scale > 0) - str = (char *) emalloc (num->n_len + num->n_scale + 2 + signch); + str = (char *) safe_emalloc (1, num->n_len + num->n_scale, 2 + signch); else - str = (char *) emalloc (num->n_len + 1 + signch); + str = (char *) safe_emalloc (1, num->n_len, 1 + signch); if (str == NULL) bc_out_of_memory(); /* The negative sign if needed. */ -- cgit v1.2.1