Mercurial > hg
comparison mercurial/mpatch.c @ 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 | d6afb6dbf9f2 |
children | a29decbf7475 |
comparison
equal
deleted
inserted
replaced
281:574420507d8c | 282:97d83e7fbf2f |
---|---|
42 struct flist *a = NULL; | 42 struct flist *a = NULL; |
43 | 43 |
44 a = malloc(sizeof(struct flist)); | 44 a = malloc(sizeof(struct flist)); |
45 if (a) { | 45 if (a) { |
46 a->base = malloc(sizeof(struct frag) * size); | 46 a->base = malloc(sizeof(struct frag) * size); |
47 if (!a->base) | 47 if (!a->base) { |
48 free(a); | 48 free(a); |
49 else | 49 a = NULL; |
50 } else | |
50 a->head = a->tail = a->base; | 51 a->head = a->tail = a->base; |
51 } | 52 } |
52 return a; | 53 return a; |
53 } | 54 } |
54 | 55 |