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

Thomas Monjalon thomas at monjalon.net
Tue Apr 17 13:47:43 CEST 2018


I see no reason to accept this patch, replacing strdup by snprintf,
given that we have strlcpy.
Please do a v3 with strlcpy.

17/04/2018 13:16, zhouyangchao:
> As Burakov said, for no other reason, I just followed the old version.
> 
> On Tue, Apr 17, 2018 at 6:31 PM Burakov, Anatoly <anatoly.burakov at intel.com>
> wrote:
> 
> > On 17-Apr-18 11:24 AM, Thomas Monjalon wrote:
> > > 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
> > >
> >
> > Yes, it seems that strlcpy thingie was merged without much fanfare. I'll
> > be submitting a patch fixing various usages of snprintf in my recent
> > commits. I'm inclined to leave this as is for this commit, as it's not
> > the purpose of this fix.





More information about the dev mailing list