Coverity issue 143258: not freeing distributor instance
Coverity issue 143254: not checking return code from malloc
Fixes:
775003ad2f96 ("distributor: add new burst-capable library")
Signed-off-by: David Hunt <david.hunt@intel.com>
if (alg_type == RTE_DIST_ALG_SINGLE) {
d = malloc(sizeof(struct rte_distributor));
+ if (d == NULL) {
+ rte_errno = ENOMEM;
+ return NULL;
+ }
d->d_v20 = rte_distributor_create_v20(name,
socket_id, num_workers);
if (d->d_v20 == NULL) {
+ free(d);
/* rte_errno will have been set */
return NULL;
}