Skip to content

Commit

Permalink
Merge pull request #12671 from badone/wip-ceph_test_rados_api_cmd-val…
Browse files Browse the repository at this point in the history
…grind-fixes

test/librados/cmd.cc: Fix trivial memory leaks

Reviewed-by: Kefu Chai <kchai@redhat.com>
  • Loading branch information
badone committed Jan 4, 2017
2 parents f7ddb77 + da5e60c commit dc01b4b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/librados/cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dc01b4b

Please sign in to comment.