Changeset 4e65f42 for lib/trace.c


Ignore:
Timestamp:
05/11/06 11:40:21 (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:
83445f0
Parents:
3fcb8b4
Message:

Fixed segmentation faults when trace_destroy is called on a trace that wasn't successfully created
libdl is now checked for and only linked against if available (BSD's don't have a libdl)
Fixed the libpacketdump .so's to use libtrace's generic protocol headers as well as trace_ether_ntoa
Added missing check for strlcpy
Added a couple of #defines to various tools that needed them under FreeBSD
Removed some needless #includes from the libpacketdump .so's

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/trace.c

    r77285d9 r4e65f42  
    577577DLLEXPORT void trace_destroy(libtrace_t *libtrace) {
    578578        assert(libtrace);
    579         if (libtrace->started && libtrace->format->pause_input)
    580                 libtrace->format->pause_input(libtrace);
    581         libtrace->format->fin_input(libtrace);
     579        if (libtrace->format) {
     580                if (libtrace->started && libtrace->format->pause_input)
     581                        libtrace->format->pause_input(libtrace);
     582                libtrace->format->fin_input(libtrace);
     583        }
    582584        /* need to free things! */
    583         free(libtrace->uridata);
    584         destroy_tracefifo(libtrace->fifo);
     585        if (libtrace->uridata)
     586                free(libtrace->uridata);
     587        if (libtrace->fifo)
     588                destroy_tracefifo(libtrace->fifo);
    585589        free(libtrace);
    586590}
Note: See TracChangeset for help on using the changeset viewer.