Changeset d0bc7e2


Ignore:
Timestamp:
01/07/19 18:16:12 (23 months ago)
Author:
Shane Alcock <salcock@…>
Branches:
develop
Children:
2bce91d
Parents:
6514097 (diff), 630460b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch '87' of git://github.com/jacobvw/libtrace into jacobvw-87

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/format_linux_common.c

    r509ee47 r630460b  
    7070        pcap_t *pcap;
    7171
    72         /* Take a copy of the filter object as it was passed in */
    73         f = (libtrace_filter_t *) malloc(sizeof(libtrace_filter_t));
    74         memcpy(f, filter, sizeof(libtrace_filter_t));
     72        /* Take a copy of the filter structure to prevent against
     73         * deletion causing the filter to no longer work */
     74        f = (libtrace_filter_t *) malloc(sizeof(libtrace_filter_t));
     75        memcpy(f, filter, sizeof(libtrace_filter_t));
     76        f->filterstring = strdup(filter->filterstring);
    7577
    7678        /* If we are passed a filter with "flag" set to zero, then we must
     
    120122
    121123        if (FORMAT_DATA->filter != NULL)
    122                 free(FORMAT_DATA->filter);
     124                trace_destroy_filter(FORMAT_DATA->filter);
    123125
    124126        FORMAT_DATA->filter = f;
     
    498500        if (libtrace->format_data) {
    499501                if (FORMAT_DATA->filter != NULL)
    500                         free(FORMAT_DATA->filter);
     502                        trace_destroy_filter(FORMAT_DATA->filter);
    501503
    502504                if (FORMAT_DATA->per_stream)
  • lib/format_linux_ring.c

    rd439067 r8df87c4  
    308308                }
    309309
    310                 if (FORMAT_DATA->filter != NULL)
    311                         free(FORMAT_DATA->filter);
     310                if (FORMAT_DATA->filter != NULL)
     311                        trace_destroy_filter(FORMAT_DATA->filter);
    312312
    313313                if (FORMAT_DATA->per_stream)
Note: See TracChangeset for help on using the changeset viewer.