Skip to content

Commit 21ee152

Browse files
committed
Prevent regression of a previous bug
1 parent 6f3c1b9 commit 21ee152

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/MPI/ibverbs.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ void IBVerbs :: stageQPs( size_t maxMsgs )
289289

290290
struct ibv_qp * const ibv_new_qp_p = ibv_create_qp( m_pd.get(), &attr );
291291

292-
m_stagedQps[i].reset( ibv_new_qp_p, ibv_destroy_qp );
292+
if( ibv_new_qp_p == NULL ) {
293+
m_stagedQps[i].reset();
294+
} else {
295+
m_stagedQps[i].reset( ibv_new_qp_p, ibv_destroy_qp );
296+
}
293297
if (!m_stagedQps[i]) {
294298
LOG( 1, "Could not create Infiniband Queue pair number " << i );
295299
throw std::bad_alloc();

0 commit comments

Comments
 (0)