From 2d7320d0b09d7a9aab4e5dbc5458f37bfb6ce9f5 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 1 Sep 2006 00:32:39 +0200 Subject: Use xmalloc instead of malloc Signed-off-by: Jonas Fonseca Signed-off-by: Junio C Hamano --- config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index d9f2b787b9..c0897cc807 100644 --- a/config.c +++ b/config.c @@ -565,7 +565,7 @@ int git_config_set_multivar(const char* key, const char* value, /* * Validate the key and while at it, lower case it for matching. */ - store.key = (char*)malloc(strlen(key)+1); + store.key = xmalloc(strlen(key) + 1); dot = 0; for (i = 0; key[i]; i++) { unsigned char c = key[i]; @@ -633,7 +633,7 @@ int git_config_set_multivar(const char* key, const char* value, } else store.do_not_match = 0; - store.value_regex = (regex_t*)malloc(sizeof(regex_t)); + store.value_regex = (regex_t*)xmalloc(sizeof(regex_t)); if (regcomp(store.value_regex, value_regex, REG_EXTENDED)) { fprintf(stderr, "Invalid pattern: %s\n", -- cgit v1.2.3