test_librbd.cc: close va_list before return in error case

Fix for:
[src/test/librbd/test_librbd.cc:322]: (error) va_list 'ap' was
 opened but not closed by va_end().
[src/test/librbd/test_librbd.cc:379]: (error) va_list 'ap' was
 opened but not closed by va_end().

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
Danny Al-Gaaf 2015-01-07 10:32:14 +01:00
parent cf85fb04bb
commit 699e869548

View File

@ -322,6 +322,7 @@ int test_ls(rados_ioctx_t io_ctx, size_t num_expected, ...)
image_names.erase(it);
} else {
ADD_FAILURE() << "Unable to find image " << expected;
va_end(ap);
return -ENOENT;
}
}
@ -379,6 +380,7 @@ int test_ls_pp(librbd::RBD& rbd, librados::IoCtx& io_ctx, size_t num_expected, .
vector<string>::iterator listed_name = find(names.begin(), names.end(), string(expected));
if (listed_name == names.end()) {
ADD_FAILURE() << "Unable to find image " << expected;
va_end(ap);
return -ENOENT;
}
names.erase(listed_name);