changeset 282:97d83e7fbf2f

mpatch: properly NULL out return in lalloc -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 mpatch: properly NULL out return in lalloc From: K Thananchayan <thananck@yahoo.com> manifest hash: 69952cb34e184eff19e3abff7638eb3a446f4dca -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCp0B+ywK+sNU5EO8RAuGdAJ4iZOnxExpZuhTjO0fcOFE9mNn/IACgjXbw 7mVqfBJeLbxViBorImLE12k= =A1Vj -----END PGP SIGNATURE-----
author mpm@selenic.com
date Wed, 08 Jun 2005 11:01:18 -0800
parents 574420507d8c
children 18c9566ad717
files mercurial/mpatch.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mpatch.c	Wed Jun 08 10:59:18 2005 -0800
+++ b/mercurial/mpatch.c	Wed Jun 08 11:01:18 2005 -0800
@@ -44,9 +44,10 @@
 	a = malloc(sizeof(struct flist));
 	if (a) {
 		a->base = malloc(sizeof(struct frag) * size);
-		if (!a->base)
+		if (!a->base) {
 			free(a);
-		else
+			a = NULL;
+		} else
 			a->head = a->tail = a->base;
 	}
 	return a;