Avoid a crash if realloc returns a different pointer.
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
1cd88cc9e6
commit
34c5a9e284
@ -1202,6 +1202,7 @@ read_message( FILE *f, msg_data_t *msg )
|
||||
p = xrealloc(msg->data, len+1);
|
||||
if (!p)
|
||||
break;
|
||||
msg->data = p;
|
||||
}
|
||||
r = fread( &msg->data[msg->len], 1, len - msg->len, f );
|
||||
if (r <= 0)
|
||||
|
Loading…
Reference in New Issue
Block a user