test tool, WRITESAME(16) UNMAP test: Avoid leaking 'buf' if a precondition fails
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
64e800a437
commit
9f89f220f5
@@ -30,7 +30,7 @@ test_writesame16_unmap(void)
|
|||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
unsigned char *buf = malloc(65536 * block_size);
|
unsigned char *buf;
|
||||||
|
|
||||||
CHECK_FOR_DATALOSS;
|
CHECK_FOR_DATALOSS;
|
||||||
CHECK_FOR_THIN_PROVISIONING;
|
CHECK_FOR_THIN_PROVISIONING;
|
||||||
@@ -39,6 +39,7 @@ test_writesame16_unmap(void)
|
|||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the start of the LUN");
|
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the start of the LUN");
|
||||||
|
buf = malloc(65536 * block_size);
|
||||||
for (i = 1; i <= 256; i++) {
|
for (i = 1; i <= 256; i++) {
|
||||||
logging(LOG_VERBOSE, "Write %d blocks of 0xFF", i);
|
logging(LOG_VERBOSE, "Write %d blocks of 0xFF", i);
|
||||||
memset(buf, 0xff, i * block_size);
|
memset(buf, 0xff, i * block_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user