git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8c9a337
)
cmdline: fix small memory leak
author
Erik Ziegenbalg
<eziegenb@brocade.com>
Wed, 20 May 2015 00:04:55 +0000
(17:04 -0700)
committer
Thomas Monjalon
<thomas.monjalon@6wind.com>
Fri, 29 May 2015 18:27:23 +0000
(20:27 +0200)
A function in cmdline.c has a return that does not free buf properly.
Signed-off-by: Erik Ziegenbalg <eziegenb@brocade.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: John McNamara <john.mcnamara@intel.com>
lib/librte_cmdline/cmdline.c
patch
|
blob
|
history
diff --git
a/lib/librte_cmdline/cmdline.c
b/lib/librte_cmdline/cmdline.c
index
6a55f1f
..
c405878
100644
(file)
--- a/
lib/librte_cmdline/cmdline.c
+++ b/
lib/librte_cmdline/cmdline.c
@@
-193,8
+193,10
@@
cmdline_printf(const struct cmdline *cl, const char *fmt, ...)
va_start(ap, fmt);
ret = vsnprintf(buf, BUFSIZ, fmt, ap);
va_end(ap);
- if (ret < 0)
+ if (ret < 0) {
+ free(buf);
return;
+ }
if (ret >= BUFSIZ)
ret = BUFSIZ - 1;
write(cl->s_out, buf, ret);