From: Brad Hubbard Date: Mon, 26 Dec 2016 23:16:30 +0000 (+1000) Subject: test/librados/cmd.cc: Fix trivial memory leaks X-Git-Tag: v12.0.0~304^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=da5e60cd70bd21b172b02795416732c5b8afa2ff;p=ceph.git test/librados/cmd.cc: Fix trivial memory leaks Signed-off-by: Brad Hubbard --- diff --git a/src/test/librados/cmd.cc b/src/test/librados/cmd.cc index 878a8af603bf..0db73471326c 100644 --- a/src/test/librados/cmd.cc +++ b/src/test/librados/cmd.cc @@ -116,9 +116,13 @@ TEST(LibRadosCmd, OSDCmd) { // note: tolerate NXIO here in case the cluster is thrashing out underneath us. cmd[0] = (char *)"asdfasdf"; r = rados_osd_command(cluster, 0, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen); + rados_buffer_free(buf); + rados_buffer_free(st); ASSERT_TRUE(r == -22 || r == -ENXIO); cmd[0] = (char *)"version"; r = rados_osd_command(cluster, 0, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen); + rados_buffer_free(buf); + rados_buffer_free(st); ASSERT_TRUE(r == -22 || r == -ENXIO); cmd[0] = (char *)"{\"prefix\":\"version\"}"; r = rados_osd_command(cluster, 0, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen); @@ -168,6 +172,8 @@ TEST(LibRadosCmd, PGCmd) { // note: tolerate NXIO here in case the cluster is thrashing out underneath us. int r = rados_pg_command(cluster, pgid.c_str(), (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen); ASSERT_TRUE(r == -22 || r == -ENXIO); + rados_buffer_free(buf); + rados_buffer_free(st); // make sure the pg exists on the osd before we query it rados_ioctx_t io;