libdasd: Free memory for previously used sysfs path

util_path_sysfs() allocates memory for the created path which must be
freed by the user.

Fixes: 8023a72b11 ("libdasd: Provide function to read ese sysfs attribute")
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Jan Höppner
2021-07-06 16:37:52 +02:00
parent ec83da3a39
commit 74e6ebe1df
+1
View File
@@ -91,6 +91,7 @@ int dasd_sys_ese(char *devnode)
rc = fgetc(fp) - '0';
fclose(fp);
free(path);
return (rc == 1) ? 1 : 0;
}