Message ID | 20201217172005.632904-1-i.maximets@ovn.org |
---|---|
State | Accepted |
Headers | show |
Series | [ovs-dev] test-stream: Silence memory leak report. | expand |
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>
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>
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 --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; }
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(+)