Reverted buffer allocation and removed unnecessary newline character

pull/3054/head
Javier Jaramago Fernández 6 years ago committed by René Cannaò
parent 5d5b810b3e
commit fa991397bd

@ -468,10 +468,9 @@ bool GTID_Server_Data::read_next_gtid() {
char rec_msg[80];
if (strncmp(data+pos,(char *)"ST=",3)==0) {
// we are reading the bootstrap
char *bs = (char *)malloc(l+1+1-3); // length + 1 (null byte) + 1 (newline) - 3 (header)
char *bs = (char *)malloc(l+1-3); // length + 1 (null byte) - 3 (header)
memcpy(bs, data+pos+3, l-3);
bs[l-3] = '\0';
bs[l-3+1] = '\n';
char *saveptr1=NULL;
char *saveptr2=NULL;
//char *saveptr3=NULL;

Loading…
Cancel
Save