Fix a segfault if we try to close a nullpointer.

Same local or in the smb plugin.
This commit is contained in:
Andreas Schneider 2008-04-25 10:57:35 +02:00
parent e6b45181f3
commit dd6cc1f83c
2 changed files with 8 additions and 0 deletions

View file

@ -104,6 +104,10 @@ static int _close(csync_vio_method_handle_t *fhandle) {
int rc = -1; int rc = -1;
smb_fhandle_t *handle = NULL; smb_fhandle_t *handle = NULL;
if (fhandle == NULL) {
return -1;
}
handle = (smb_fhandle_t *) fhandle; handle = (smb_fhandle_t *) fhandle;
rc = smbc_close(handle->fd); rc = smbc_close(handle->fd);

View file

@ -72,6 +72,10 @@ int csync_vio_local_close(csync_vio_method_handle_t *fhandle) {
int rc = -1; int rc = -1;
fhandle_t *handle = NULL; fhandle_t *handle = NULL;
if (fhandle == NULL) {
return -1;
}
handle = (fhandle_t *) fhandle; handle = (fhandle_t *) fhandle;
rc = close(handle->fd); rc = close(handle->fd);