]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
policy/gp: always close a file (CID 1445119)
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 14 May 2019 22:54:33 +0000 (10:54 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 6 Jul 2020 12:30:33 +0000 (12:30 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/lib/policy/gp_filesys.c

index 5a300f134fea57e4fbe7150911a53eb6989c695e..eaae5b79230449db267fcf47386fec01ab85faaa 100644 (file)
@@ -486,6 +486,7 @@ static NTSTATUS push_recursive (struct gp_context *gp_ctx, const char *local_pat
                                        DBG_ERR("read failed with errno %s\n",
                                                strerror(errno));
                                        status = NT_STATUS_UNSUCCESSFUL;
+                                       close(local_fd);
                                        goto done;
                                }
                                smbcli_write(gp_ctx->cli->tree, remote_fd, 0,