diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2016-02-06 16:58:08 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2016-02-06 16:58:08 +0100 |
commit | 7b011db764a852d1b3821e30ee1c2f1c4ea9f51c (patch) | |
tree | a223425464ac9588c84d5258fc7d372ac0f851e1 /camlibs/st2205 | |
parent | ffa682f8837b9ecc3fdf2926bf4b0ad57cee9886 (diff) | |
download | libgphoto2-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.c | 2 |
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 */ |