[Pdbg] [PATCH 2/3] tests: Fix the usage for pdbg_target_path()
Amitay Isaacs
amitay at ozlabs.org
Mon Feb 17 11:36:23 AEDT 2020
Signed-off-by: Amitay Isaacs <amitay at ozlabs.org>
---
src/tests/libpdbg_dtree_test.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/tests/libpdbg_dtree_test.c b/src/tests/libpdbg_dtree_test.c
index d3c4a89..318a347 100644
--- a/src/tests/libpdbg_dtree_test.c
+++ b/src/tests/libpdbg_dtree_test.c
@@ -32,7 +32,6 @@ static void print_tree(struct pdbg_target *target, bool system, int level)
{
struct pdbg_target *child;
const char *name;
- char *path;
int i;
for (i=0; i<level; i++)
@@ -41,9 +40,7 @@ static void print_tree(struct pdbg_target *target, bool system, int level)
name = pdbg_target_dn_name(target);
if (!name || name[0] == '\0')
name = "/";
- path = pdbg_target_path(target);
- printf("%s (%s)\n", name, path);
- free(path);
+ printf("%s (%s)\n", name, pdbg_target_path(target));
for_each_child(target, child, system)
print_tree(child, system, level+1);
--
2.24.1
More information about the Pdbg
mailing list