mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
cpumf/pai.c: Fix memory use after free
Preventing a race condition by freeing the pmuname variable only after its last usage. Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Polensky <japo@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
8a88ada9c5
commit
fe7bef3f09
@@ -735,8 +735,8 @@ static int add_events(int type)
|
||||
}
|
||||
|
||||
if (rc) {
|
||||
free(pmuname);
|
||||
warnx("failed building event list for %s", pmuname);
|
||||
free(pmuname);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user