Changeset eea427f


Ignore:
Timestamp:
08/25/15 13:38:54 (5 years ago)
Author:
Richard Sanger <rsangerarj@…>
Branches:
4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, 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:
54cf135
Parents:
4007dbb
Message:

Fix memory leak with trace_make_packet_safe

Make packet safe was not freeing the copied packet structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace_parallel.c

    r4007dbb reea427f  
    377377DLLEXPORT void libtrace_make_packet_safe(libtrace_packet_t *pkt) {
    378378        // Duplicate the packet in standard malloc'd memory and free the
    379         // original, This is a 1:1 exchange so is ocache count remains unchanged.
     379        // original, This is a 1:1 exchange so the ocache count remains unchanged.
    380380        if (pkt->buf_control != TRACE_CTRL_PACKET) {
    381381                libtrace_packet_t *dup;
     
    385385                /* Copy the duplicated packet over the existing */
    386386                memcpy(pkt, dup, sizeof(libtrace_packet_t));
     387                /* Free the packet structure */
     388                free(dup);
    387389        }
    388390}
Note: See TracChangeset for help on using the changeset viewer.