You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by GitBox <gi...@apache.org> on 2021/05/24 11:10:10 UTC

[GitHub] [plc4x] chrisdutz edited a comment on pull request #244: plc4c: memory plumbing

chrisdutz edited a comment on pull request #244:
URL: https://github.com/apache/plc4x/pull/244#issuecomment-846969455


   Well I think only the parser can know if it needs to alloc memory for the optional field. But code like this will always produce segfaults:
   
   `      
   //dataUnitReferenceNumber = malloc(sizeof(uint8_t));
   //if(dataUnitReferenceNumber == NULL) {
   //  return NO_MEMORY;
   //}
   *dataUnitReferenceNumber = 0;
   `


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org