Skip to content

Commit d4b8d90

Browse files
committed
test_librbd.cc: fix USE_AFTER_FREE
Fix for: CID 1251462 (#1 of 1): Use after free (USE_AFTER_FREE) 1. alias: Assigning: cur_name = names. Now both point to the same storage. 3. freed_arg: free frees names. 6. pass_freed_arg: Passing freed pointer cur_name as an argument to printf. Signed-off-by: Danny Al-Gaaf <[email protected]>
1 parent e6161b7 commit d4b8d90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/test/librbd/test_librbd.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ int test_ls(rados_ioctx_t io_ctx, size_t num_expected, ...)
333333
printf("expected = %s\n", expected);
334334
std::set<std::string>::iterator it = image_names.find(expected);
335335
if (it != image_names.end()) {
336-
printf("found %s\n", cur_name);
336+
printf("found %s\n", expected);
337337
image_names.erase(it);
338338
} else {
339339
ADD_FAILURE() << "Unable to find image " << expected;

0 commit comments

Comments
 (0)