From: Shiju Jose Date: Wed, 16 Oct 2019 16:33:56 +0000 (+0100) Subject: rasdaemon: fix memory leak in ras-events.c:handle_ras_events() X-Git-Tag: v0.6.5~8 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5bea49b6e7e85d96e4a0fc1c48d5dd17e6a4f7b2;p=users%2Fmchehab%2Frasdaemon.git 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 --- 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);