libselinux: audit2why: close fd on enomem
Potential file descriptor leak on this code path, need to close file descriptor if out of memory. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
dd563b35e1
commit
74a9a52966
|
@ -235,6 +235,7 @@ static int __policy_init(const char *init_path)
|
|||
avc = calloc(sizeof(struct avc_t), 1);
|
||||
if (!avc) {
|
||||
PyErr_SetString( PyExc_MemoryError, "Out of memory\n");
|
||||
fclose(fp);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue