Use xrealloc instead of realloc
Change places that use realloc, without a proper error path, to instead use xrealloc. Drop an erroneous error path in the daemon code that used errno in the die message in favour of the simpler xrealloc. 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
095c424d08
commit
83572c1a91
@@ -392,7 +392,7 @@ create_delta(const struct delta_index *index,
|
||||
outsize = max_size + MAX_OP_SIZE + 1;
|
||||
if (max_size && outpos > max_size)
|
||||
break;
|
||||
out = realloc(out, outsize);
|
||||
out = xrealloc(out, outsize);
|
||||
if (!out) {
|
||||
free(tmp);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user