summaryrefslogtreecommitdiff
path: root/camlibs/st2205
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2016-02-06 16:58:08 +0100
committerMarcus Meissner <marcus@jet.franken.de>2016-02-06 16:58:08 +0100
commit7b011db764a852d1b3821e30ee1c2f1c4ea9f51c (patch)
treea223425464ac9588c84d5258fc7d372ac0f851e1 /camlibs/st2205
parentffa682f8837b9ecc3fdf2926bf4b0ad57cee9886 (diff)
downloadlibgphoto2-7b011db764a852d1b3821e30ee1c2f1c4ea9f51c.tar.gz
close the fd before returning from the function (Coverity)
1033364 Resource leak
Diffstat (limited to 'camlibs/st2205')
-rw-r--r--camlibs/st2205/st2205.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/camlibs/st2205/st2205.c b/camlibs/st2205/st2205.c
index d732700a3..db224ab1a 100644
--- a/camlibs/st2205/st2205.c
+++ b/camlibs/st2205/st2205.c
@@ -53,9 +53,9 @@ static char *st2205_malloc_page_aligned(int size)
fd = open ("/dev/zero", O_RDWR);
aligned = mmap (0, size, PROT_READ|PROT_WRITE,MAP_PRIVATE, fd, 0);
+ close (fd);
if (aligned == MAP_FAILED)
return NULL;
-
return aligned;
#else
/* hope for the best */