return len;
if(!reorder_data && drand48() < reorder) {
reorder_data = malloc(len);
+ if(!reorder_data) {
+ debug("Out of memory\n");
+ return len;
+ }
reorder_len = len;
memcpy(reorder_data, data, len);
reorder_countdown = 1 + drand48() * reorder_dist;
if(len > sizeof hdr) {
uint32_t datalen = len - sizeof hdr;
uint8_t *str = malloc((datalen << 1) + 7);
+ if(!str) {
+ debug("out of memory");
+ return;
+ }
memcpy(str, " data=", 6);
uint8_t *strptr = str + 6;
const uint8_t *data = pkt;