Skip to content

Commit

Permalink
pybind: fix valgrind warning on rbd_get_parent_info call
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 2586e3b)
  • Loading branch information
Jason Dillaman committed Jul 17, 2015
1 parent aa3eb28 commit a4fc63a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pybind/rbd.py
Expand Up @@ -466,8 +466,12 @@ def parent_info(self):
pool = create_string_buffer(size)
name = create_string_buffer(size)
snapname = create_string_buffer(size)
ret = self.librbd.rbd_get_parent_info(self.image, pool, len(pool),
name, len(name), snapname, len(snapname))
ret = self.librbd.rbd_get_parent_info(self.image, byref(pool),
c_size_t(size),
byref(name),
c_size_t(size),
byref(snapname),
c_size_t(size))
if ret == -errno.ERANGE:
size *= 2

Expand Down

0 comments on commit a4fc63a

Please sign in to comment.