From 2371d31f64e8b1238e86d86c5b6f20ac5a842799 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Jan 2008 18:44:19 -0800 Subject: Fix resource leak found by coverity (CID 521). Jeremy. (This used to be commit acfb233acc7324b8d431d5cb777a1933d173b3dc) --- source3/smbd/reply.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source3/smbd/reply.c') diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 27f380a627..a796a3193b 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -6355,6 +6355,7 @@ void reply_copy(struct smb_request *req) directory, dname); if (!fname) { + CloseDir(dir_hnd); reply_nterror(req, NT_STATUS_NO_MEMORY); END_PROFILE(SMBcopy); return; @@ -6365,6 +6366,7 @@ void reply_copy(struct smb_request *req) continue; } if (!destname) { + CloseDir(dir_hnd); reply_nterror(req, NT_STATUS_NO_MEMORY); END_PROFILE(SMBcopy); return; @@ -6372,6 +6374,7 @@ void reply_copy(struct smb_request *req) status = check_name(conn, fname); if (!NT_STATUS_IS_OK(status)) { + CloseDir(dir_hnd); reply_nterror(req, status); END_PROFILE(SMBcopy); return; @@ -6379,6 +6382,7 @@ void reply_copy(struct smb_request *req) status = check_name(conn, destname); if (!NT_STATUS_IS_OK(status)) { + CloseDir(dir_hnd); reply_nterror(req, status); END_PROFILE(SMBcopy); return; -- cgit