[dpdk-dev] [PATCH v2] mem: memory leaks of hubedir caused by strdup

Thomas Monjalon thomas at monjalon.net
Tue Apr 17 12:24:42 CEST 2018


17/04/2018 12:06, Yangchao Zhou:
> Coverity issue: 272585
> Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary")
> 
> Signed-off-by: Yangchao Zhou <zhouyates at gmail.com>
> Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>

Better to provide a small explanation.

> -					retval = strdup(splitstr[MOUNTPT]);
> +					snprintf(hugedir, len, "%s", splitstr[MOUNTPT]);

I think it is candidate to be replaced by strlcpy.
Please check





More information about the dev mailing list