Skip to content

Commit

Permalink
ibacm: Fix a memory leak in an acm_open_dev() error path
Browse files Browse the repository at this point in the history
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 <bvanassche@acm.org>
  • Loading branch information
bvanassche committed Jan 13, 2020
1 parent 32b9486 commit d04d466
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ibacm/src/acm.c
Expand Up @@ -2654,6 +2654,8 @@ static void acm_open_dev(struct ibv_device *ibdev)
return;
}

free(dev);

err1:
ibv_close_device(verbs);
}
Expand Down

0 comments on commit d04d466

Please sign in to comment.