From bfcb7f64c1c3045455d35f1833b8f135ab0cfac1 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Thu, 30 Aug 2018 14:58:56 -0700 Subject: [PATCH] vhost: Stop memory leak in external foreach loop This is in response to a Scan-build issue reported on Clang 6. Change-Id: I2edc853145762998db818cbbe0e9ca0d9b8c123d Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/424139 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Ben Walker --- lib/vhost/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c index 1120477dd..626ffeb06 100644 --- a/lib/vhost/vhost.c +++ b/lib/vhost/vhost.c @@ -961,6 +961,7 @@ spdk_vhost_event_async_send(struct spdk_vhost_dev *vdev, spdk_vhost_event_fn cb_ ev_ctx = calloc(1, sizeof(*ev_ctx)); if (ev_ctx == NULL) { SPDK_ERRLOG("Failed to alloc vhost event.\n"); + assert(false); return -ENOMEM; }