]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
c_read_operations.cc: fix resource leak
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sat, 1 Mar 2014 10:44:39 +0000 (11:44 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sat, 1 Mar 2014 10:44:39 +0000 (11:44 +0100)
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 <danny.al-gaaf@bisect.de>
src/test/librados/c_read_operations.cc

index 106f6b4f162d99e36f5641da4393d2e1025117a3..053b6147ba511b64eabca63bea20e95bd352ad44 100644 (file)
@@ -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);