We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7130153 commit d288a0dCopy full SHA for d288a0d
1 file changed
src/wolfscp.c
@@ -610,6 +610,15 @@ int DoScpSource(WOLFSSH* ssh)
610
continue;
611
}
612
if (ret < 0) {
613
+ #if !defined(NO_FILESYSTEM) && \
614
+ !defined(WOLFSSH_SCP_USER_CALLBACKS)
615
+ /* if the socket send had a fatal error, try to close any
616
+ * open file descriptor before exit */
617
+ ScpSendCtx* sendCtx = NULL;
618
+ sendCtx = (ScpSendCtx*)wolfSSH_GetScpSendCtx(ssh);
619
+ if (sendCtx != NULL)
620
+ WFCLOSE(ssh->fs, sendCtx->fp);
621
+ #endif
622
WLOG(WS_LOG_ERROR, scpError, "failed to send file", ret);
623
break;
624
0 commit comments