From fe750755740a8fc70e54cfbe4f0414b4f2ed4079 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Sat, 10 May 2014 10:58:56 +0200 Subject: [PATCH] test_librbd.cc: fix sizeof() in malloc call Use 'char' instead of 'char *'. 228 names = (char *) malloc(sizeof(char *) * 1024); Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'char *' Signed-off-by: Danny Al-Gaaf --- src/test/librbd/test_librbd.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 7f354187277..fdc33d3d3de 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -225,7 +225,7 @@ int test_ls(rados_ioctx_t io_ctx, size_t num_expected, ...) va_list ap; size_t max_size = 1024; - names = (char *) malloc(sizeof(char *) * 1024); + names = (char *) malloc(sizeof(char) * 1024); int len = rbd_list(io_ctx, names, &max_size); for (i = 0, num_images = 0, cur_name = names; cur_name < names + len; i++) { -- 2.47.3