Avoid a crash if realloc returns a different pointer.
authorMike McCormack <mike@codeweavers.com>
Wed, 5 Apr 2006 14:22:19 +0000 (23:22 +0900)
committerJunio C Hamano <junkio@cox.net>
Wed, 5 Apr 2006 20:00:07 +0000 (13:00 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
imap-send.c

index ea56dc9..52e2400 100644 (file)
@@ -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)