close() was never called for the passed in IoCtx which
could probably result in an IoCtx leak if the original
IoCtx was a valid pool context allocated earlier.
Its kind of better to do it here rather than to leave
the destruction on the caller for better (or cleaner)
common case handling.
Signed-off-by: Venky Shankar <vshankar@redhat.com>
int ret = rados_ioctx_create((rados_t)client, name, &p);
if (ret)
return ret;
+ io.close();
io.io_ctx_impl = (IoCtxImpl*)p;
return 0;
}
int ret = rados_ioctx_create2((rados_t)client, pool_id, &p);
if (ret)
return ret;
+ io.close();
io.io_ctx_impl = (IoCtxImpl*)p;
return 0;
}
if (ret) {
return ret;
}
+
+ io.close();
io.io_ctx_impl = reinterpret_cast<IoCtxImpl*>(p);
return 0;
}
if (ret) {
return ret;
}
+
+ io.close();
io.io_ctx_impl = reinterpret_cast<IoCtxImpl*>(p);
return 0;
}