Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
* [lttng-dev] [PATCH lttng-tools] Fix: Free new_chunk on error
@ 2019-09-20 14:47 Jonathan Rajotte
  2019-09-20 21:34 ` Jérémie Galarneau
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Rajotte @ 2019-09-20 14:47 UTC (permalink / raw)


Fixes coverity #1405775

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 src/common/trace-chunk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/common/trace-chunk.c b/src/common/trace-chunk.c
index 6770bd982..bad993bea 100644
--- a/src/common/trace-chunk.c
+++ b/src/common/trace-chunk.c
@@ -367,6 +367,8 @@ end:
 	return new_chunk;
 error_unlock:
 	pthread_mutex_unlock(&source_chunk->lock);
+	lttng_trace_chunk_fini(new_chunk);
+	free(new_chunk);
 	return NULL;
 }
 
-- 
2.17.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-09-20 21:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 14:47 [lttng-dev] [PATCH lttng-tools] Fix: Free new_chunk on error Jonathan Rajotte
2019-09-20 21:34 ` Jérémie Galarneau
2019-09-20 21:37   ` Jonathan Rajotte-Julien
2019-09-20 21:42     ` Jonathan Rajotte-Julien

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox