Changeset 2725318 for lib/format_bpf.c


Ignore:
Timestamp:
11/22/18 11:59:29 (2 years ago)
Author:
Jacob Van Walraven <jcv9@…>
Branches:
develop
Children:
33b735c
Parents:
2dc1d9b
Message:

Cleanup some of the assertions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/format_bpf.c

    ra0f031b r2725318  
    123123
    124124/* Initialises a BPF input trace */
    125 static int bpf_init_input(libtrace_t *libtrace)
    126 {
     125static int bpf_init_input(libtrace_t *libtrace) {
    127126        libtrace->format_data = (struct libtrace_format_data_t *)
    128127                malloc(sizeof(struct libtrace_format_data_t));
    129        
     128
     129        if (!libtrace->format_data) {
     130                trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "Unable to allocate memory bpf_init_input()");
     131                return -1;
     132        }
     133
    130134        /* Throw some default values into the format data */
    131135        FORMATIN(libtrace)->fd = -1;
Note: See TracChangeset for help on using the changeset viewer.