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 /checkout-cache.c | |
parent | update-cache: remove index lock file on SIGINT (diff) | |
download | tgif-812666c8e66a21e668c0789d0422aa5a7db54961.tar.xz |
[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 'checkout-cache.c')
-rw-r--r-- | checkout-cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/checkout-cache.c b/checkout-cache.c index d1661eb5f8..a1ef9448c3 100644 --- a/checkout-cache.c +++ b/checkout-cache.c @@ -39,7 +39,7 @@ static int force = 0, quiet = 0, not_new = 0; static void create_directories(const char *path) { int len = strlen(path); - char *buf = malloc(len + 1); + char *buf = xmalloc(len + 1); const char *slash = path; while ((slash = strchr(slash+1, '/')) != NULL) { |