From: Yehuda Sadeh Date: Mon, 30 Sep 2013 22:40:02 +0000 (-0700) Subject: librados: pool async create / delete does not delete completion handle X-Git-Tag: mark-v0.70-wip~8^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=46057925a8d409e70d29a073fe2afaff94333c36;p=ceph.git librados: pool async create / delete does not delete completion handle Backport: dumpling The pool async delete / create function used to delete the internal completion object. However, caller still holds the allocated completion object, which it can't drop a reference to (as it'd try to deallocate the already freed internal object). This fix removes the internal object deletion, a following commit will fix a related leak (#6444) by having the application (radosgw) drop the reference even if got an error. Signed-off-by: Yehuda Sadeh --- diff --git a/src/librados/RadosClient.cc b/src/librados/RadosClient.cc index 8a5f499ec152..1be3ebd10f90 100644 --- a/src/librados/RadosClient.cc +++ b/src/librados/RadosClient.cc @@ -459,7 +459,6 @@ int librados::RadosClient::pool_create_async(string& name, PoolAsyncCompletionIm Context *onfinish = new C_PoolAsync_Safe(c); int r = objecter->create_pool(name, onfinish, auid, crush_rule); if (r < 0) { - delete c; delete onfinish; } return r; @@ -505,7 +504,6 @@ int librados::RadosClient::pool_delete_async(const char *name, PoolAsyncCompleti Context *onfinish = new C_PoolAsync_Safe(c); int r = objecter->delete_pool(tmp_pool_id, onfinish); if (r < 0) { - delete c; delete onfinish; } return r;