From 74e6ebe1df64e6c9b688200e1fb8c58c8195150b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20H=C3=B6ppner?= Date: Tue, 6 Jul 2021 16:37:52 +0200 Subject: [PATCH] libdasd: Free memory for previously used sysfs path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit util_path_sysfs() allocates memory for the created path which must be freed by the user. Fixes: 8023a72b11c8 ("libdasd: Provide function to read ese sysfs attribute") Signed-off-by: Jan Höppner --- libdasd/dasd_sys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libdasd/dasd_sys.c b/libdasd/dasd_sys.c index 020b52d0..a11a565f 100644 --- a/libdasd/dasd_sys.c +++ b/libdasd/dasd_sys.c @@ -91,6 +91,7 @@ int dasd_sys_ese(char *devnode) rc = fgetc(fp) - '0'; fclose(fp); + free(path); return (rc == 1) ? 1 : 0; }