patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v3] eal: fix resource leak
       [not found] <20170922144820.16590-1-danielx.t.mrzyglod@intel.com>
@ 2017-10-11 11:53 ` Daniel Mrzyglod
  2017-10-11 12:43   ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Mrzyglod @ 2017-10-11 11:53 UTC (permalink / raw)
  To: thomas; +Cc: dev, Daniel Mrzyglod, stable

Memory allocated in strdup is not free.

Coverity issue: 143257
Fixes: d8a2bc71dfc2 ("log: remove app path from syslog id")
Cc: thomas@monjalon.net
Cc: stable@dpdk.org

Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
---
v3: 
* remove strdup because it's basically striped argv[0]
v2:
* Fix due to compilation errors
 
 lib/librte_eal/linuxapp/eal/eal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index 1f07347..739b61a 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -763,7 +763,7 @@ rte_eal_init(int argc, char **argv)
 	}
 
 	logid = strrchr(argv[0], '/');
-	logid = strdup(logid ? logid + 1: argv[0]);
+	logid = logid ? logid + 1 : argv[0];
 
 	thread_id = pthread_self();
 
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH v3] eal: fix resource leak
  2017-10-11 11:53 ` [dpdk-stable] [PATCH v3] eal: fix resource leak Daniel Mrzyglod
@ 2017-10-11 12:43   ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2017-10-11 12:43 UTC (permalink / raw)
  To: Daniel Mrzyglod; +Cc: stable, dev

11/10/2017 13:53, Daniel Mrzyglod:
> Memory allocated in strdup is not free.
> 
> Coverity issue: 143257
> Fixes: d8a2bc71dfc2 ("log: remove app path from syslog id")
> Cc: thomas@monjalon.net
> Cc: stable@dpdk.org
> 
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>

Given this recent commit:
	http://dpdk.org/commit/e3f141879ef
I think we should consider this issue as a false positive.

The arguments given to rte_eal_init may be freed.
So it's better to strdup them, even if it is never freed.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-11 12:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170922144820.16590-1-danielx.t.mrzyglod@intel.com>
2017-10-11 11:53 ` [dpdk-stable] [PATCH v3] eal: fix resource leak Daniel Mrzyglod
2017-10-11 12:43   ` Thomas Monjalon

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).