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 ea56dc9ae5e2110c88a3538a9559a6e6d0adb23c..52e2400b57118e7f9a27c85212e1c539d16add7c 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)