aboutsummaryrefslogtreecommitdiffstats
path: root/libselinux/src/audit2why.c
diff options
context:
space:
mode:
authorDan Walsh <dwalsh@redhat.com>2011-10-27 10:00:21 -0400
committerEric Paris <eparis@redhat.com>2011-11-02 15:37:11 -0400
commit74a9a5296688e2617d669b346d3f5ef6e31ae2d9 (patch)
tree4789d3eb75f5bbb6c8a7c4d1374d827c0ab2c39e /libselinux/src/audit2why.c
parentdd563b35e1f6918e5c96de29ea255b04ad34e891 (diff)
downloadandroid_external_selinux-74a9a5296688e2617d669b346d3f5ef6e31ae2d9.tar.gz
android_external_selinux-74a9a5296688e2617d669b346d3f5ef6e31ae2d9.tar.bz2
android_external_selinux-74a9a5296688e2617d669b346d3f5ef6e31ae2d9.zip
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>
Diffstat (limited to 'libselinux/src/audit2why.c')
-rw-r--r--libselinux/src/audit2why.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libselinux/src/audit2why.c b/libselinux/src/audit2why.c
index 62ba02c5..1bf35994 100644
--- a/libselinux/src/audit2why.c
+++ b/libselinux/src/audit2why.c
@@ -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;
}