[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/1] tools/symbols: fix memory leak in build_initial_tok_table()



Free the table[i].sym field of the invalid sym_entry since
it is malloc'ed data.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@xxxxxxx>
---
 xen/tools/symbols.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c
index 710e9785d3..8daa588d2f 100644
--- a/xen/tools/symbols.c
+++ b/xen/tools/symbols.c
@@ -422,6 +422,8 @@ static void build_initial_tok_table(void)
                                table[pos] = table[i];
                        learn_symbol(table[pos].sym, table[pos].len);
                        pos++;
+                       } else {
+                               free(table[i].sym);
                }
        }
        table_cnt = pos;
-- 
2.17.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.