diff mbox series

[2/7] rasdaemon: fix memory leak in ras-events.c:handle_ras_events()

Message ID 20191016163401.16980-3-shiju.jose@huawei.com (mailing list archive)
State Accepted
Headers show
Series rasdaemon: add fixes, database closure and signal handling | expand

Commit Message

Shiju Jose Oct. 16, 2019, 4:33 p.m. UTC
This patch fix memory leak in handle_ras_events()
when failed to trace all supported RAS events.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
---
 ras-events.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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);