You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2018/03/08 10:40:54 UTC
qpid-cpp git commit: QPID-8118: check device list before freeing
Repository: qpid-cpp
Updated Branches:
refs/heads/master 88f105c93 -> 790d0fc84
QPID-8118: check device list before freeing
Patch from Michael Ivanov <iv...@logit-ag.de>
Project: http://git-wip-us.apache.org/repos/asf/qpid-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-cpp/commit/790d0fc8
Tree: http://git-wip-us.apache.org/repos/asf/qpid-cpp/tree/790d0fc8
Diff: http://git-wip-us.apache.org/repos/asf/qpid-cpp/diff/790d0fc8
Branch: refs/heads/master
Commit: 790d0fc849ba9e45c26c381557d7813967eaa325
Parents: 88f105c
Author: Gordon Sim <gs...@redhat.com>
Authored: Thu Mar 8 10:38:31 2018 +0000
Committer: Gordon Sim <gs...@redhat.com>
Committed: Thu Mar 8 10:38:31 2018 +0000
----------------------------------------------------------------------
src/qpid/sys/rdma/rdma_wrap.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-cpp/blob/790d0fc8/src/qpid/sys/rdma/rdma_wrap.cpp
----------------------------------------------------------------------
diff --git a/src/qpid/sys/rdma/rdma_wrap.cpp b/src/qpid/sys/rdma/rdma_wrap.cpp
index 39c7cc2..86d41d9 100644
--- a/src/qpid/sys/rdma/rdma_wrap.cpp
+++ b/src/qpid/sys/rdma/rdma_wrap.cpp
@@ -45,8 +45,11 @@ namespace Rdma {
// This is moderately inefficient so don't use in a critical path
int deviceCount() {
+ struct ibv_device **list;
int count;
- ::ibv_free_device_list(::ibv_get_device_list(&count));
+
+ if ((list = ::ibv_get_device_list(&count)))
+ ::ibv_free_device_list(list);
return count;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org