DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Ferruh Yigit <ferruh.yigit@intel.com>,
	Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] eal: fix resource leak
Date: Fri, 06 Oct 2017 00:33:23 +0200	[thread overview]
Message-ID: <4160089.UZJ91qkqPz@xps> (raw)
In-Reply-To: <27670627-01f0-7fff-0aa8-c9a9d2b89e3d@intel.com>

04/10/2017 21:24, Ferruh Yigit:
> On 9/22/2017 3:48 PM, Daniel Mrzyglod wrote:
> > Memory allocated in strdup is not free.
> > 
> > Coverity issue: 143257
> > Fixes: d8a2bc71dfc2 ("log: remove app path from syslog id")
> > Cc: thomas@monjalon.net
> > 
> > Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
> > ---
> This works but this variable is a nuance and adding free() for this it
> into main eal features fail path looks like noise.
> 
> Initially, do we need to strdup this variable at all?
> What will happen if logid fed into rte_eal_log_init() without strdup?
> Since it is const char *, I guess the string is just for read and
> content won't be changed so it should be OK I guess.
> 
> If above is not right, what about creating a static variable and use it
> instead of dynamically allocating the logid, what do you think?

Good proposal Ferruh.
It seems strdup is not needed as it is basically argv[0].

  reply	other threads:[~2017-10-05 22:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-19 13:34 [dpdk-dev] [PATCH] " Daniel Mrzyglod
2017-09-22 14:48 ` [dpdk-dev] [PATCH v2] " Daniel Mrzyglod
2017-10-02 14:16   ` Jastrzebski, MichalX K
2017-10-04 19:24   ` Ferruh Yigit
2017-10-05 22:33     ` Thomas Monjalon [this message]
2017-10-11 11:53   ` [dpdk-dev] [PATCH v3] " Daniel Mrzyglod
2017-10-11 12:43     ` [dpdk-dev] [dpdk-stable] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4160089.UZJ91qkqPz@xps \
    --to=thomas@monjalon.net \
    --cc=danielx.t.mrzyglod@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).