Use xmalloc() and friends to catch allocation failures
Some places use the standard malloc/strdup without checking if the allocation was successful; they should use xmalloc/xstrdup that check the memory allocation result. Signed-off-by: Dotan Barak <dotanba@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
4886b89f8f
commit
e8eec71d6e
2
http.c
2
http.c
@ -402,7 +402,7 @@ static struct fill_chain *fill_cfg = NULL;
|
||||
|
||||
void add_fill_function(void *data, int (*fill)(void *))
|
||||
{
|
||||
struct fill_chain *new = malloc(sizeof(*new));
|
||||
struct fill_chain *new = xmalloc(sizeof(*new));
|
||||
struct fill_chain **linkp = &fill_cfg;
|
||||
new->data = data;
|
||||
new->fill = fill;
|
||||
|
Reference in New Issue
Block a user