diff options
author | Christopher Li <git@chrisli.org> | 2005-04-26 12:00:58 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-26 12:00:58 -0700 |
commit | 812666c8e66a21e668c0789d0422aa5a7db54961 (patch) | |
tree | b98a096f4b3c70aac3110f905a1367c23b402cca /blob.c | |
parent | f2a19340ada1188e278d5b198d3466ed7411e2d4 (diff) | |
download | git-812666c8e66a21e668c0789d0422aa5a7db54961.tar.gz |
[PATCH] introduce xmalloc and xrealloc
Introduce xmalloc and xrealloc to die gracefully with a descriptive
message when out of memory, rather than taking a SIGSEGV.
Signed-off-by: Christopher Li<chrislgit@chrisli.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'blob.c')
-rw-r--r-- | blob.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -8,7 +8,7 @@ struct blob *lookup_blob(unsigned char *sha1) { struct object *obj = lookup_object(sha1); if (!obj) { - struct blob *ret = malloc(sizeof(struct blob)); + struct blob *ret = xmalloc(sizeof(struct blob)); memset(ret, 0, sizeof(struct blob)); created_object(sha1, &ret->object); ret->object.type = blob_type; |