Commit 8e8c360b authored by Krzysztof Karas's avatar Krzysztof Karas Committed by Jim Harris
Browse files

bdevperf: free job->zipf



Currently we do not free the memory allocated
during spdk_zipf_create() call, when we exit
the for loop on line 1769 with error. Remedy
this problem by adding spdk_zipf_free() calls.

Change-Id: I1d593ad2375204b158a2c97b23e492e69f836f43
Signed-off-by: default avatarKrzysztof Karas <krzysztof.karas@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17405


Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Community-CI: Mellanox Build Bot
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarAleksey Marchuk <alexeymar@nvidia.com>
parent 6648ea0f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1770,6 +1770,7 @@ bdevperf_construct_job(struct spdk_bdev *bdev, struct job_config *config,
		task = calloc(1, sizeof(struct bdevperf_task));
		if (!task) {
			fprintf(stderr, "Failed to allocate task from memory\n");
			spdk_zipf_free(&job->zipf);
			return -ENOMEM;
		}

@@ -1777,6 +1778,7 @@ bdevperf_construct_job(struct spdk_bdev *bdev, struct job_config *config,
					 SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA);
		if (!task->buf) {
			fprintf(stderr, "Cannot allocate buf for task=%p\n", task);
			spdk_zipf_free(&job->zipf);
			free(task);
			return -ENOMEM;
		}
@@ -1787,6 +1789,7 @@ bdevperf_construct_job(struct spdk_bdev *bdev, struct job_config *config,
						    SPDK_ENV_LCORE_ID_ANY, SPDK_MALLOC_DMA);
			if (!task->md_buf) {
				fprintf(stderr, "Cannot allocate md buf for task=%p\n", task);
				spdk_zipf_free(&job->zipf);
				spdk_free(task->buf);
				free(task);
				return -ENOMEM;