Skip to contentSkip to conversation

tests: test-bdrv-graph-mod: fix memory leak

PATCH In review Li Qiang 4 participants 4 messages Mar 10, 2019 – Mar 12, 2019

lore
Share & tools
lore

Li Qiang

author
#0 lore raw

PATCH 1/1 tests: test-bdrv-graph-mod: fix memory leak

Fixes 2dbfadf

Spotted by ASAN when 'make check'.

---
 tests/test-bdrv-graph-mod.c | 1 +
 1 file changed, 1 insertion(+)
tests/test-bdrv-graph-mod.c +1 -0
index 458dfa6661..8bf0fe735d 100644
@@ -117,6 +117,7 @@ static void test_update_perm_tree(void)
 
     bdrv_unref(bs);
     blk_unref(root);
+    error_free(local_err);
 }
 
 /*
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Li Qiang
Fixes 2dbfadf

^ Please keep tags together (with Signed-off-by, ...)

Quoted 1 line

Spotted by ASAN when 'make check'.

I'm not native English speaker but I'd say:

Spotted by ASAN [with] 'make check'.

or

Spotted by ASAN [while running] 'make check'.

Here goes:

"Fixes: 2dbfadf"

Quoted 10 lines
---
 tests/test-bdrv-graph-mod.c | 1 +
 1 file changed, 1 insertion(+)
tests/test-bdrv-graph-mod.c +0 -0
index 458dfa6661..8bf0fe735d 100644

tests/test-bdrv-graph-mod.c static void test_update_perm_tree(void) · line 120

Quoted 4 lines
tests/test-bdrv-graph-mod.c +1 -0
@@ -117,6 +117,7 @@ static void test_update_perm_tree(void)
 
     bdrv_unref(bs);
     blk_unref(root);
+    error_free(local_err);
Quoted 4 lines
tests/test-bdrv-graph-mod.c +0 -0
 }
 
 /*
#2 lore raw
Quoted 10 lines · Philippe Mathieu-Daudé <[email protected]> 于2019年3月10日周日 下午10:34写道:
Quoted 1 line · Li Qiang
Fixes 2dbfadf

^ Please keep tags together (with Signed-off-by, ...)

Quoted 1 line

Spotted by ASAN when 'make check'.

I'm not native English speaker but I'd say:

Thanks your advice.
Hope the maintainer will do this minor adjustment.

Thanks,
Li Qiang

Quoted 32 lines

Spotted by ASAN [with] 'make check'.

or

Spotted by ASAN [while running] 'make check'.

Here goes:

"Fixes: 2dbfadf"

Quoted 10 lines
---
 tests/test-bdrv-graph-mod.c | 1 +
 1 file changed, 1 insertion(+)
tests/test-bdrv-graph-mod.c +0 -0
index 458dfa6661..8bf0fe735d 100644

tests/test-bdrv-graph-mod.c static void test_update_perm_tree(void) · line 120

Quoted 4 lines
tests/test-bdrv-graph-mod.c +1 -0
@@ -117,6 +117,7 @@ static void test_update_perm_tree(void)
 
     bdrv_unref(bs);
     blk_unref(root);
+    error_free(local_err);
Quoted 4 lines
tests/test-bdrv-graph-mod.c +0 -0
 }
 
 /*
Reviewed-by on v1 1/1
#3 lore raw
In reply to Li Qiang
Quoted 4 lines · Li Qiang
Fixes 2dbfadf

Spotted by ASAN when 'make check'.

Oops, my fault, thank you for fixing this!

Quoted 17 lines
---
  tests/test-bdrv-graph-mod.c | 1 +
  1 file changed, 1 insertion(+)
tests/test-bdrv-graph-mod.c +1 -0
index 458dfa6661..8bf0fe735d 100644
@@ -117,6 +117,7 @@ static void test_update_perm_tree(void)
 
      bdrv_unref(bs);
      blk_unref(root);
+    error_free(local_err);
  }
 
  /*
Signature · 2 lines
Best regards,
Vladimir