From 02ef25e43b9a1ab479e2b1bbdaee4538dfc206ca Mon Sep 17 00:00:00 2001 From: Michel Hidalgo Date: Mon, 1 Jun 2020 16:23:44 -0300 Subject: [PATCH] Ensure rcl_publisher_init() fails safely. Signed-off-by: Michel Hidalgo --- rcl/src/rcl/publisher.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rcl/src/rcl/publisher.c b/rcl/src/rcl/publisher.c index 7666352d8..67c4778f7 100644 --- a/rcl/src/rcl/publisher.c +++ b/rcl/src/rcl/publisher.c @@ -198,6 +198,7 @@ rcl_publisher_init( fail: if (publisher->impl) { allocator->deallocate(publisher->impl, allocator->state); + publisher->impl = NULL; } ret = fail_ret;