diff mbox series

[ovs-dev] test-stream: Silence memory leak report.

Message ID 20201217172005.632904-1-i.maximets@ovn.org
State Accepted
Headers show
Series [ovs-dev] test-stream: Silence memory leak report. | expand

Commit Message

Ilya Maximets Dec. 17, 2020, 5:20 p.m. UTC
AddressSanitizer reports this as a leak.
Let's just free the memory before exiting to avoid the noise.

'stream_close()' doesn't update the pointer, so this will not
change the return value.

Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 tests/test-stream.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Flavio Leitner Dec. 17, 2020, 6:12 p.m. UTC | #1
On Thu, Dec 17, 2020 at 06:20:05PM +0100, Ilya Maximets wrote:
> AddressSanitizer reports this as a leak.
> Let's just free the memory before exiting to avoid the noise.
> 
> 'stream_close()' doesn't update the pointer, so this will not
> change the return value.
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Acked-by: Flavio Leitner <fbl@sysclose.org>
Paolo Valerio Dec. 18, 2020, 7:19 p.m. UTC | #2
Ilya Maximets <i.maximets@ovn.org> writes:

> AddressSanitizer reports this as a leak.
> Let's just free the memory before exiting to avoid the noise.
>
> 'stream_close()' doesn't update the pointer, so this will not
> change the return value.
>
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>  tests/test-stream.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tests/test-stream.c b/tests/test-stream.c
> index 4af44200e..68ce2c544 100644
> --- a/tests/test-stream.c
> +++ b/tests/test-stream.c
> @@ -42,5 +42,6 @@ main(int argc, char *argv[])
>          VLOG_ERR("stream_open_block(%s) failure: %s",
>                   argv[1], ovs_strerror(error));
>      }
> +    stream_close(stream);
>      return (error || !stream) ? 1 : 0;
>  }
> -- 

Acked-by: Paolo Valerio <pvalerio@redhat.com>
Ilya Maximets Dec. 21, 2020, 11:12 p.m. UTC | #3
On 12/17/20 6:20 PM, Ilya Maximets wrote:
> AddressSanitizer reports this as a leak.
> Let's just free the memory before exiting to avoid the noise.
> 
> 'stream_close()' doesn't update the pointer, so this will not
> change the return value.
> 
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---
>  tests/test-stream.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/test-stream.c b/tests/test-stream.c
> index 4af44200e..68ce2c544 100644
> --- a/tests/test-stream.c
> +++ b/tests/test-stream.c
> @@ -42,5 +42,6 @@ main(int argc, char *argv[])
>          VLOG_ERR("stream_open_block(%s) failure: %s",
>                   argv[1], ovs_strerror(error));
>      }
> +    stream_close(stream);
>      return (error || !stream) ? 1 : 0;
>  }
> 

Applied.  Thanks, Flavio and Paolo!

Best regards, Ilya Maximets.
diff mbox series

Patch

diff --git a/tests/test-stream.c b/tests/test-stream.c
index 4af44200e..68ce2c544 100644
--- a/tests/test-stream.c
+++ b/tests/test-stream.c
@@ -42,5 +42,6 @@  main(int argc, char *argv[])
         VLOG_ERR("stream_open_block(%s) failure: %s",
                  argv[1], ovs_strerror(error));
     }
+    stream_close(stream);
     return (error || !stream) ? 1 : 0;
 }