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:
Dan Walsh 2011-10-27 10:00:21 -04:00 committed by Eric Paris
parent dd563b35e1
commit 74a9a52966
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}