[dpdk-stable] [PATCH v3] net/softnic: fix memory leak in parsing arguments

Singh, Jasvinder jasvinder.singh at intel.com
Wed Jul 14 13:07:30 CEST 2021


<snip>

> +	free(firmware);

Memory for firmware is not allocated dynamically, so no need for this.

<snip>

>  struct pmd_params {
> -	const char *name;
> -	const char *firmware;
> +	char name[RTE_DEV_NAME_MAX_LEN];

Please replace " RTE_DEV_NAME_MAX_LEN " with "NAME_SIZE" which is already defined in softnic_internals.h

> +	char firmware[PATH_MAX];

Also, instead of using PATH_MAX, define new macro "SOFTNIC_PATH_MAX   4096" in softnic_internals.h


>  	uint16_t conn_port;
>  	uint32_t cpu_id;
>  	int sc; /**< Service cores. */
> --
> 2.27.0



More information about the stable mailing list