From 812666c8e66a21e668c0789d0422aa5a7db54961 Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Tue, 26 Apr 2005 12:00:58 -0700 Subject: [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 Signed-off-by: Linus Torvalds --- read-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'read-cache.c') diff --git a/read-cache.c b/read-cache.c index f67aceb6b1..2354e8039b 100644 --- a/read-cache.c +++ b/read-cache.c @@ -143,7 +143,7 @@ int add_cache_entry(struct cache_entry *ce, int ok_to_add) /* Make sure the array is big enough .. */ if (active_nr == active_alloc) { active_alloc = alloc_nr(active_alloc); - active_cache = realloc(active_cache, active_alloc * sizeof(struct cache_entry *)); + active_cache = xrealloc(active_cache, active_alloc * sizeof(struct cache_entry *)); } /* Add it in.. */ -- cgit v1.2.3