From 5bea49b6e7e85d96e4a0fc1c48d5dd17e6a4f7b2 Mon Sep 17 00:00:00 2001 From: Shiju Jose Date: Wed, 16 Oct 2019 17:33:56 +0100 Subject: [PATCH] rasdaemon: fix memory leak in ras-events.c:handle_ras_events() This patch fix memory leak in handle_ras_events() when failed to trace all supported RAS events. Signed-off-by: Shiju Jose Signed-off-by: Mauro Carvalho Chehab --- ras-events.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ras-events.c b/ras-events.c index d1773b1..d543251 100644 --- a/ras-events.c +++ b/ras-events.c @@ -846,7 +846,8 @@ int handle_ras_events(int record_events) if (!num_events) { log(ALL, LOG_INFO, "Failed to trace all supported RAS events. Aborting.\n"); - return EINVAL; + rc = -EINVAL; + goto err; } data = calloc(sizeof(*data), cpus); -- 2.50.1