]> arthur.barton.de Git - netatalk.git/commitdiff
libatalk: avoid double close in ad_openat
authorRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Wed, 13 Feb 2013 20:58:00 +0000 (21:58 +0100)
committerRiccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Wed, 13 Feb 2013 21:00:30 +0000 (22:00 +0100)
Partly revert 8852315e574879a9548c31f84c6eaea59f1db90f

Reported by Coverity as CID #980995.

libatalk/adouble/ad_open.c

index a4a56b122f3d45783ca694135e453426bf07cb69..3cedebabfcedd958813d2a89ad270efd8f832f93 100644 (file)
@@ -1828,8 +1828,6 @@ int ad_openat(struct adouble  *ad,
 
     if (dirfd != -1) {
         if ((cwdfd = open(".", O_RDONLY) == -1) || (fchdir(dirfd) != 0))
-            if (cwdfd > 0)
-                close(cwdfd);
             EC_FAIL;
     }