Avoid a crash if realloc returns a different pointer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Mike McCormack 2006-04-05 23:22:19 +09:00 коммит произвёл Junio C Hamano
Родитель 1cd88cc9e6
Коммит 34c5a9e284
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -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)