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 <g...@redhat.com>
Authored: Thu Mar 8 10:38:31 2018 +0000
Committer: Gordon Sim <g...@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-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to