[Python-checkins] r71311 - python/branches/py3k-short-float-repr/Python/dtoa.c

mark.dickinson python-checkins at python.org
Mon Apr 6 16:22:34 CEST 2009


Author: mark.dickinson
Date: Mon Apr 6 16:22:34 2009
New Revision: 71311
Log:
rv_alloc and nrv_alloc should return NULL on failure
Modified:
 python/branches/py3k-short-float-repr/Python/dtoa.c
Modified: python/branches/py3k-short-float-repr/Python/dtoa.c
==============================================================================
--- python/branches/py3k-short-float-repr/Python/dtoa.c	(original)
+++ python/branches/py3k-short-float-repr/Python/dtoa.c	Mon Apr 6 16:22:34 2009
@@ -2005,6 +2005,8 @@
 		j <<= 1)
 			k++;
 	r = (int*)Balloc(k);
+	if (r == NULL)
+		return NULL;
 	*r = k;
 	return (char *)(r+1);
 	}
@@ -2014,7 +2016,10 @@
 {
 	char *rv, *t;
 
-	t = rv = rv_alloc(n);
+	rv = rv_alloc(n);
+	if (rv == NULL)
+		return NULL;
+	t = rv;
 	while((*t = *s++)) t++;
 	if (rve)
 		*rve = t;


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /