From: Danny Al-Gaaf Date: Sat, 1 Mar 2014 10:44:39 +0000 (+0100) Subject: c_read_operations.cc: fix resource leak X-Git-Tag: v0.78~108^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3cd751b0a280909510c3e633cc8cd4b9f5e3b2d9;p=ceph.git c_read_operations.cc: fix resource leak CID 1188154 (#2 of 2): Resource leak (RESOURCE_LEAK) overwrite_var: Overwriting "op" in "op = rados_create_read_op()" leaks the storage that "op" points to. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/test/librados/c_read_operations.cc b/src/test/librados/c_read_operations.cc index 106f6b4f162d..053b6147ba51 100644 --- a/src/test/librados/c_read_operations.cc +++ b/src/test/librados/c_read_operations.cc @@ -365,6 +365,7 @@ TEST_F(CReadOpsTest, ExecUserBuf) { // buffer too short bytes_read = 1024; + rados_release_read_op(op); op = rados_create_read_op(); rados_read_op_exec_user_buf(op, "rbd", "get_all_features", NULL, 0, out, sizeof(features) - 1, &bytes_read, &rval);