Skip to content

Commit d04d466

Browse files
committed
ibacm: Fix a memory leak in an acm_open_dev() error path
This patch fixes the following Coverity complaint: CID 1490689 (linux-rdma#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 <bvanassche@acm.org>
1 parent 32b9486 commit d04d466

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ibacm/src/acm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2654,6 +2654,8 @@ static void acm_open_dev(struct ibv_device *ibdev)
26542654
return;
26552655
}
26562656

2657+
free(dev);
2658+
26572659
err1:
26582660
ibv_close_device(verbs);
26592661
}

0 commit comments

Comments
 (0)