mercurial/bdiff.c
branchstable
changeset 16071 8134ec8627e7
parent 15530 eeac5e179243
child 16385 e501f45b0eba
--- a/mercurial/bdiff.c	Mon Feb 06 14:37:49 2012 +0900
+++ b/mercurial/bdiff.c	Fri Feb 03 23:27:17 2012 +0000
@@ -443,7 +443,7 @@
 	r = PyBytes_AsString(s);
 	rlen = PyBytes_Size(s);
 
-	w = (char *)malloc(rlen);
+	w = (char *)malloc(rlen ? rlen : 1);
 	if (!w)
 		goto nomem;