summaryrefslogtreecommitdiff
path: root/ext/bigdecimal
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r--ext/bigdecimal/bigdecimal.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 89653f4904..65f412e6d7 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -3779,9 +3779,6 @@ VP_EXPORT void *
VpMemAlloc(size_t mb)
{
void *p = xmalloc(mb);
- if (!p) {
- VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1);
- }
memset(p, 0, mb);
#ifdef BIGDECIMAL_DEBUG
gnAlloc++; /* Count allocation call */
@@ -3792,11 +3789,7 @@ VpMemAlloc(size_t mb)
VP_EXPORT void *
VpMemRealloc(void *ptr, size_t mb)
{
- void *p = xrealloc(ptr, mb);
- if (!p) {
- VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1);
- }
- return p;
+ return xrealloc(ptr, mb);
}
VP_EXPORT void
@@ -4348,7 +4341,6 @@ VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
/* at least mx digits. */
/* szVal==NULL ==> allocate zero value. */
vp = VpAllocReal(mx);
- /* xmalloc() always returns(or throw interruption) */
vp->MaxPrec = mx; /* set max precision */
VpSetZero(vp, 1); /* initialize vp to zero. */
return vp;
@@ -4524,7 +4516,6 @@ VpAlloc(size_t mx, const char *szVal, int strict_p, int exc)
nalloc = Max(nalloc, mx);
mx = nalloc;
vp = VpAllocReal(mx);
- /* xmalloc() always returns(or throw interruption) */
vp->MaxPrec = mx; /* set max precision */
VpSetZero(vp, sign);
VpCtoV(vp, psz, ni, psz + ipf, nf, psz + ipe, ne);