Commit e73007a6 authored by Daniel Verkamp's avatar Daniel Verkamp
Browse files

nvme/perf: fix memory leaks on error conditions



This doesn't really matter, since the program will be exiting
immediately if associate_workers_with_ns() fails, but it makes static
analyzers happy.

Change-Id: Ic21d234dec50bd2b6684b5fe2caa78d616f93052
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 16a45d25
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -784,10 +784,13 @@ associate_workers_with_ns(void)
#ifdef HAVE_LIBAIO
		ns_ctx->events = calloc(g_queue_depth, sizeof(struct io_event));
		if (!ns_ctx->events) {
			free(ns_ctx);
			return -1;
		}
		ns_ctx->ctx = 0;
		if (io_setup(g_queue_depth, &ns_ctx->ctx) < 0) {
			free(ns_ctx->events);
			free(ns_ctx);
			perror("io_setup");
			return -1;
		}