Use xmalloc instead of malloc
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:

committed by
Junio C Hamano

parent
ef1186228d
commit
2d7320d0b0
@ -84,7 +84,7 @@ static int get_value(const char* key_, const char* regex_)
|
||||
*tl = tolower(*tl);
|
||||
|
||||
if (use_key_regexp) {
|
||||
key_regexp = (regex_t*)malloc(sizeof(regex_t));
|
||||
key_regexp = (regex_t*)xmalloc(sizeof(regex_t));
|
||||
if (regcomp(key_regexp, key, REG_EXTENDED)) {
|
||||
fprintf(stderr, "Invalid key pattern: %s\n", key_);
|
||||
goto free_strings;
|
||||
@ -97,7 +97,7 @@ static int get_value(const char* key_, const char* regex_)
|
||||
regex_++;
|
||||
}
|
||||
|
||||
regexp = (regex_t*)malloc(sizeof(regex_t));
|
||||
regexp = (regex_t*)xmalloc(sizeof(regex_t));
|
||||
if (regcomp(regexp, regex_, REG_EXTENDED)) {
|
||||
fprintf(stderr, "Invalid pattern: %s\n", regex_);
|
||||
goto free_strings;
|
||||
|
Reference in New Issue
Block a user