From: Danny Al-Gaaf Date: Thu, 12 Mar 2015 22:21:54 +0000 (+0100) Subject: cls/rgw/cls_rgw_types.cc: fix RESOURCE_LEAK X-Git-Tag: v9.0.0~95^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b4cfe7321f78d8a6d6991cf10e441dad1eb75136;p=ceph.git cls/rgw/cls_rgw_types.cc: fix RESOURCE_LEAK Call push_back() for the generated entry object. Fix for: CID 1274297 (#1 of 1): Resource leak (RESOURCE_LEAK) 3. leaked_storage: Variable entry going out of scope leaks the storage it points to. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/cls/rgw/cls_rgw_types.cc b/src/cls/rgw/cls_rgw_types.cc index 89c8476d71d2..faec1a304012 100644 --- a/src/cls/rgw/cls_rgw_types.cc +++ b/src/cls/rgw/cls_rgw_types.cc @@ -263,6 +263,7 @@ void rgw_bucket_olh_log_entry::generate_test_instances(listkey.name = "key.name"; entry->key.instance = "key.instance"; entry->delete_marker = true; + o.push_back(entry); o.push_back(new rgw_bucket_olh_log_entry); }