diff mbox series

[2/4] test-bdrv-graph-mod: fix Error leak

Message ID 20190312141324.28572-3-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show
Series Fix sanitizer failures | expand

Commit Message

Paolo Bonzini March 12, 2019, 2:13 p.m. UTC
Reported by ASAN.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/test-bdrv-graph-mod.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Blake March 12, 2019, 2:42 p.m. UTC | #1
On 3/12/19 9:13 AM, Paolo Bonzini wrote:
> Reported by ASAN.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  tests/test-bdrv-graph-mod.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/test-bdrv-graph-mod.c b/tests/test-bdrv-graph-mod.c
> index 458dfa6661..283dc84869 100644
> --- a/tests/test-bdrv-graph-mod.c
> +++ b/tests/test-bdrv-graph-mod.c
> @@ -114,6 +114,7 @@ static void test_update_perm_tree(void)
>      bdrv_append(filter, bs, &local_err);
>  
>      g_assert_nonnull(local_err);
> +    error_free(local_err);

Better would be using error_free_or_abort(&local_err) instead of these
two lines.
diff mbox series

Patch

diff --git a/tests/test-bdrv-graph-mod.c b/tests/test-bdrv-graph-mod.c
index 458dfa6661..283dc84869 100644
--- a/tests/test-bdrv-graph-mod.c
+++ b/tests/test-bdrv-graph-mod.c
@@ -114,6 +114,7 @@  static void test_update_perm_tree(void)
     bdrv_append(filter, bs, &local_err);
 
     g_assert_nonnull(local_err);
+    error_free(local_err);
 
     bdrv_unref(bs);
     blk_unref(root);