delete corrected to free for malloc

This commit is contained in:
vivek-shankar 2017-04-11 20:23:21 -04:00
parent 6db4069f0d
commit 4c99bb6acc
2 changed files with 4 additions and 4 deletions

View File

@ -91,7 +91,7 @@ namespace buzz_utility{
tot += unMsgSize;
}
}while(size - tot > sizeof(uint16_t) && unMsgSize > 0);
delete[] pl;
free(pl);
/* Process messages */
buzzvm_process_inmsgs(VM);
}
@ -141,7 +141,7 @@ namespace buzz_utility{
uint64_t* payload_64 = new uint64_t[total_size];
memcpy((void*)payload_64, (void*)buff_send, total_size*sizeof(uint64_t));
delete[] buff_send;
free(buff_send);
/*for(int i=0;i<total_size;i++){
cout<<" payload from out msg "<<*(payload_64+i)<<endl;
}*/

View File

@ -350,7 +350,7 @@ namespace rosbzz_node{
uint16_t total_size =(ceil((float)(float)tot/(float)sizeof(uint64_t)));
uint64_t* payload_64 = new uint64_t[total_size];
memcpy((void*)payload_64, (void*)buff_send, total_size*sizeof(uint64_t));
delete[] buff_send;
free(buff_send);
/*Send a constant number to differenciate updater msgs*/
update_packets.payload64.push_back((uint64_t)UPDATER_MESSAGE_CONSTANT);
for(int i=0;i<total_size;i++){
@ -558,7 +558,7 @@ namespace rosbzz_node{
code_message_inqueue_process();
//fprintf(stdout,"after in queue process : utils\n");
}
delete[] pl;
free(pl);
}
/*BVM FIFO message*/
else if(msg->payload64.size() > 3){