mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Fix a segfault if we try to close a nullpointer.
Same local or in the smb plugin.
This commit is contained in:
parent
e6b45181f3
commit
dd6cc1f83c
2 changed files with 8 additions and 0 deletions
|
@ -104,6 +104,10 @@ static int _close(csync_vio_method_handle_t *fhandle) {
|
|||
int rc = -1;
|
||||
smb_fhandle_t *handle = NULL;
|
||||
|
||||
if (fhandle == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
handle = (smb_fhandle_t *) fhandle;
|
||||
|
||||
rc = smbc_close(handle->fd);
|
||||
|
|
|
@ -72,6 +72,10 @@ int csync_vio_local_close(csync_vio_method_handle_t *fhandle) {
|
|||
int rc = -1;
|
||||
fhandle_t *handle = NULL;
|
||||
|
||||
if (fhandle == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
handle = (fhandle_t *) fhandle;
|
||||
|
||||
rc = close(handle->fd);
|
||||
|
|
Loading…
Reference in a new issue