Changeset 2725318 for lib/format_dpdk.c


Ignore:
Timestamp:
11/22/18 11:59:29 (3 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_dpdk.c

    r3b94ef2 r2725318  
    587587        libtrace->format_data = (struct dpdk_format_data_t *)
    588588                                malloc(sizeof(struct dpdk_format_data_t));
     589
     590        if (!libtrace->format_data) {
     591                trace_set_err(libtrace, TRACE_ERR_INIT_FAILED, "Unable to allocate memory dpdk_init_input()");
     592                return 1;
     593        }
     594
    589595        FORMAT(libtrace)->port = 0; /* Always assume 1 port loaded */
    590596        FORMAT(libtrace)->nb_ports = 0;
     
    628634        libtrace->format_data = (struct dpdk_format_data_t *)
    629635                                malloc(sizeof(struct dpdk_format_data_t));
     636
     637        if (!libtrace->format_data) {
     638                trace_set_err_out(libtrace, TRACE_ERR_INIT_FAILED, "Unable to allocate memory dpdk_init_output()");
     639                return -1;
     640        }
    630641        FORMAT(libtrace)->port = 0; /* Always assume 1 port loaded */
    631642        FORMAT(libtrace)->nb_ports = 0;
Note: See TracChangeset for help on using the changeset viewer.