diff options
author | Gary Lowell <gary.lowell@inktank.com> | 2013-10-30 19:34:42 +0100 |
---|---|---|
committer | Gary Lowell <gary.lowell@inktank.com> | 2013-10-30 19:34:42 +0100 |
commit | dc9a7721d4d4a501254868db45de18dcb8cff85a (patch) | |
tree | 9515f6b16c826d1da6170aeb0ad45dfebc83104a | |
parent | v0.72-rc1 (diff) | |
parent | ceph: Release resource before return in BackedObject::download() (diff) | |
download | ceph-dc9a7721d4d4a501254868db45de18dcb8cff85a.tar.xz ceph-dc9a7721d4d4a501254868db45de18dcb8cff85a.zip |
Merge branch 'next' of jenkins:ceph/ceph into next
-rw-r--r-- | src/common/BackTrace.cc | 6 | ||||
-rw-r--r-- | src/os/chain_xattr.cc | 2 | ||||
-rw-r--r-- | src/tools/rados/rados_sync.cc | 1 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/common/BackTrace.cc b/src/common/BackTrace.cc index 6cace65ab6d..886ed6a16d4 100644 --- a/src/common/BackTrace.cc +++ b/src/common/BackTrace.cc @@ -36,8 +36,10 @@ void BackTrace::print(std::ostream& out) if (begin && end) { int len = end - begin; char *foo = (char *)malloc(len+1); - if (!foo) - return; + if (!foo) { + free(function); + return; + } memcpy(foo, begin, len); foo[len] = 0; diff --git a/src/os/chain_xattr.cc b/src/os/chain_xattr.cc index 62733e390d3..52ae8dba868 100644 --- a/src/os/chain_xattr.cc +++ b/src/os/chain_xattr.cc @@ -355,7 +355,7 @@ int chain_listxattr(const char *fn, char *names, size_t len) { r = sys_listxattr(fn, full_buf, total_len); if (r < 0) - return r; + goto done; char *p = full_buf; const char *end = full_buf + r; diff --git a/src/tools/rados/rados_sync.cc b/src/tools/rados/rados_sync.cc index 03293d3402a..d2d6ab54529 100644 --- a/src/tools/rados/rados_sync.cc +++ b/src/tools/rados/rados_sync.cc @@ -579,6 +579,7 @@ int BackedUpObject::download(IoCtx &io_ctx, const char *path) if (rlen < 0) { cerr << ERR_PREFIX << "download: io_ctx.read(" << rados_name << ") returned " << rlen << std::endl; + fclose(fp); return rlen; } if (rlen < CHUNK_SZ) |