Actions
Bug #14332
closedRBD: potential memory leak if image ctx is unable to open.
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