Project

General

Profile

Actions

Bug #14332

closed

RBD: potential memory leak if image ctx is unable to open.

Added by xie xingguo over 8 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Target version:
-
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

For example:

int remove(IoCtx& io_ctx, const char *imgname, ProgressContext& prog_ctx)
{
    CephContext *cct((CephContext *)io_ctx.cct());
    ldout(cct, 20) << "remove " << &io_ctx << " " << imgname << dendl;

    string id;
    bool old_format = false;
    bool unknown_format = true;
    ImageCtx *ictx = new ImageCtx(imgname, "", NULL, io_ctx, false);
    int r = ictx->state->open();
    if (r < 0)
    {
        ldout(cct, 2) << "error opening image: " << cpp_strerror(-r) << dendl;
        delete ictx; // shall manually delete ictx here.
Actions #1

Updated by Sage Weil over 8 years ago

  • Project changed from Ceph to rbd
Actions #2

Updated by Jason Dillaman over 8 years ago

  • Status changed from New to Resolved
Actions #3

Updated by Nathan Cutler about 7 years ago

  • Description updated (diff)
Actions

Also available in: Atom PDF