aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-04-11 08:39:44 +0200
committerAndreas Schneider <asn@samba.org>2017-05-15 17:20:45 +0200
commitc6bb9dfe74c51621587cc92c496fcde4721e6a6b (patch)
treeead5af1f5aea4741e2f7972371e94b61f98f53f6
parent80f27a3f776db23a79ad1da3e5967ff045c40ebe (diff)
downloadpam_wrapper-c6bb9dfe74c51621587cc92c496fcde4721e6a6b.tar.gz
pam_wrapper-c6bb9dfe74c51621587cc92c496fcde4721e6a6b.tar.xz
pam_wrapper-c6bb9dfe74c51621587cc92c496fcde4721e6a6b.zip
pwrap: Do not leak srcfd on error
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Kai Blin <kai@samba.org>
-rw-r--r--src/pam_wrapper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c
index 889c79a..4be8146 100644
--- a/src/pam_wrapper.c
+++ b/src/pam_wrapper.c
@@ -553,7 +553,8 @@ static int p_copy(const char *src, const char *dst, const char *pdir, mode_t mod
if (mode == 0) {
rc = fstat(srcfd, &sb);
if (rc != 0) {
- return -1;
+ rc = -1;
+ goto out;
}
mode = sb.st_mode;
}