From d04d4660d114bf5517eaa23217af01263a271688 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 12 Jan 2020 19:36:37 -0800 Subject: [PATCH] ibacm: Fix a memory leak in an acm_open_dev() error path This patch fixes the following Coverity complaint: CID 1490689 (#1 of 1): Resource leak (RESOURCE_LEAK) 15. leaked_storage: Variable dev going out of scope leaks the storage it points to. Signed-off-by: Bart Van Assche --- ibacm/src/acm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ibacm/src/acm.c b/ibacm/src/acm.c index ad313075c..04b84e348 100644 --- a/ibacm/src/acm.c +++ b/ibacm/src/acm.c @@ -2654,6 +2654,8 @@ static void acm_open_dev(struct ibv_device *ibdev) return; } + free(dev); + err1: ibv_close_device(verbs); }