Fixes suggested by Valgrind tool

Fixes suggested by Valgrind tool
This commit is contained in:
MassimilianoPinto
2015-09-23 11:46:00 +02:00
parent 72f08de889
commit ef15825efb

View File

@ -388,6 +388,7 @@ char task_name[BLRM_TASK_NAME_LEN+1] = "";
else if (strcmp(options[i], "master_uuid") == 0) else if (strcmp(options[i], "master_uuid") == 0)
{ {
inst->set_master_uuid = strdup(value); inst->set_master_uuid = strdup(value);
inst->master_uuid = inst->set_master_uuid;
} }
else if (strcmp(options[i], "master_version") == 0) else if (strcmp(options[i], "master_version") == 0)
{ {
@ -1329,7 +1330,8 @@ int len;
return NULL; return NULL;
memcpy(rval, (char *)(errpkt->start) + 7, 6); memcpy(rval, (char *)(errpkt->start) + 7, 6);
rval[6] = ' '; rval[6] = ' ';
memcpy(&rval[7], (char *)(errpkt->start) + 13, len - 8); /* message size is len - (1 byte field count + 2 bytes errno + 6 bytes status) */
memcpy(&rval[7], (char *)(errpkt->start) + 13, len - 9);
rval[len-2] = 0; rval[len-2] = 0;
return rval; return rval;
} }