Changeset 5eeba76 for lib/format_erf.c


Ignore:
Timestamp:
05/04/06 17:05:13 (15 years ago)
Author:
Shane Alcock <salcock@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
Children:
bc4c11e
Parents:
48a20e3
Message:

Fixed memory leak in trace_event_trace
Wrote an example using the event framework
Removed old event examples
Updated format_pcapfile to use libtrace_direction_t
erf_read_packet now checks that malloc()ing a buffer actually succeeds

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_erf.c

    r431548c5 r5eeba76  
    530530                packet->buffer = malloc(LIBTRACE_PACKET_BUFSIZE);
    531531                packet->buf_control = TRACE_CTRL_PACKET;
    532         }
    533 
     532                if (!packet->buffer) {
     533                        trace_set_err(libtrace, errno,
     534                                        "Cannot allocate memory");
     535                        return -1;
     536                }
     537        }
     538
     539       
     540       
    534541        packet->header = packet->buffer;
    535542        packet->type = RT_DATA_ERF;
Note: See TracChangeset for help on using the changeset viewer.