Found by covscan.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
struct dirent *dirent;
char *entry_local_path = NULL;
char *entry_remote_path = NULL;
- int local_fd, remote_fd;
+ int local_fd = -1, remote_fd = -1;
int buf[1024];
int nread, total_read;
struct stat s;
}
close(local_fd);
+ local_fd = -1;
smbcli_close(gp_ctx->cli->tree, remote_fd);
+ remote_fd = -1;
}
TALLOC_FREE(entry_local_path);
TALLOC_FREE(entry_remote_path);
status = NT_STATUS_OK;
done:
+ if (local_fd != -1) {
+ close(local_fd);
+ }
+ if (remote_fd != -1) {
+ smbcli_close(gp_ctx->cli->tree, remote_fd);
+ }
talloc_free(entry_local_path);
talloc_free(entry_remote_path);