mirror of
https://github.com/ceph/ceph
synced 2025-01-20 01:51:34 +00:00
cephtool: fix resource leak
CID 717124: Resource leak (RESOURCE_LEAK) At (17): Variable "m" going out of scope leaks the storage it points to. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
779e0f0fb0
commit
70e35ba9b1
@ -134,11 +134,6 @@ static void send_command(CephToolCtx *ctx)
|
||||
if (!ctx->concise)
|
||||
*ctx->log << ceph_clock_now(g_ceph_context) << " " << pending_target << " <- " << pending_cmd << std::endl;
|
||||
|
||||
MCommand *m = new MCommand(ctx->mc.monmap.fsid);
|
||||
m->cmd = pending_cmd;
|
||||
m->set_data(pending_bl);
|
||||
m->set_tid(++pending_tid);
|
||||
|
||||
if (pending_tell_pgid) {
|
||||
// pick target osd
|
||||
vector<int> osds;
|
||||
@ -172,10 +167,14 @@ static void send_command(CephToolCtx *ctx)
|
||||
reply_rc = -ESRCH;
|
||||
reply = true;
|
||||
} else {
|
||||
|
||||
if (!ctx->concise)
|
||||
*ctx->log << ceph_clock_now(g_ceph_context) << " " << pending_target << " <- " << pending_cmd << std::endl;
|
||||
|
||||
MCommand *m = new MCommand(ctx->mc.monmap.fsid);
|
||||
m->cmd = pending_cmd;
|
||||
m->set_data(pending_bl);
|
||||
m->set_tid(++pending_tid);
|
||||
|
||||
command_con = messenger->get_connection(osdmap->get_inst(n));
|
||||
messenger->send_message(m, command_con);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user