diff options
Diffstat (limited to 'sesman/chansrv')
-rw-r--r-- | sesman/chansrv/chansrv_fuse.c | 18 | ||||
-rw-r--r-- | sesman/chansrv/chansrv_fuse.h | 2 | ||||
-rw-r--r-- | sesman/chansrv/devredir.c | 9 | ||||
-rw-r--r-- | sesman/chansrv/rail.c | 1 | ||||
-rw-r--r-- | sesman/chansrv/smartcard.c | 5 | ||||
-rw-r--r-- | sesman/chansrv/smartcard_pcsc.c | 2 | ||||
-rw-r--r-- | sesman/chansrv/sound.c | 3 |
7 files changed, 24 insertions, 16 deletions
diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c index 3ec00b6e..5bef552d 100644 --- a/sesman/chansrv/chansrv_fuse.c +++ b/sesman/chansrv/chansrv_fuse.c @@ -73,7 +73,7 @@ int xfuse_create_share(tui32 device_id, char *dirname) { r void xfuse_devredir_cb_open_file(void *vp, tui32 IoStatus, tui32 DeviceId, tui32 FileId) {} void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length) {} void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length) {} -void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) {} +int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) {} void xfuse_devredir_cb_enum_dir_done(void *vp, tui32 IoStatus) {} void xfuse_devredir_cb_rmdir_or_file(void *vp, tui32 IoStatus) {} void xfuse_devredir_cb_rename_file(void *vp, tui32 IoStatus) {} @@ -1422,7 +1422,7 @@ static void xfuse_update_xrdpfs_size() * Add a file or directory to xrdp file system *****************************************************************************/ -void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) +int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) { XFUSE_INFO *fip = (XFUSE_INFO *) vp; XRDP_INODE *xip = NULL; @@ -1430,13 +1430,14 @@ void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) if ((fip == NULL) || (xinode == NULL)) { log_error("fip or xinode are NULL"); - return; + return -1; } if (!xfuse_is_inode_valid(fip->inode)) { log_error("inode %d is not valid", fip->inode); - return; + g_free(xinode); + return -1; } log_debug("parent_inode=%d name=%s", fip->inode, xinode->name); @@ -1444,8 +1445,8 @@ void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) /* if filename is . or .. don't add it */ if ((strcmp(xinode->name, ".") == 0) || (strcmp(xinode->name, "..") == 0)) { - free(xinode); - return; + g_free(xinode); + return -1; } xfuse_dump_fs(); @@ -1454,9 +1455,9 @@ void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) { log_debug("inode=%d name=%s already exists in xrdp_fs; not adding it", fip->inode, xinode->name); - free(xinode); + g_free(xinode); xip->stale = 0; - return; + return -1; } xinode->parent_inode = fip->inode; @@ -1473,6 +1474,7 @@ void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) xfuse_update_xrdpfs_size(); xfuse_dump_fs(); + return 0; } /** diff --git a/sesman/chansrv/chansrv_fuse.h b/sesman/chansrv/chansrv_fuse.h index 09011452..41a73062 100644 --- a/sesman/chansrv/chansrv_fuse.h +++ b/sesman/chansrv/chansrv_fuse.h @@ -57,7 +57,7 @@ int xfuse_file_contents_size(int stream_id, int file_size); int xfuse_add_clip_dir_item(char *filename, int flags, int size, int lindex); /* functions that are invoked from devredir */ -void xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode); +int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode); void xfuse_devredir_cb_enum_dir_done(void *vp, tui32 IoStatus); void xfuse_devredir_cb_open_file(void *vp, tui32 IoStatus, tui32 DeviceId, tui32 FileId); void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length); diff --git a/sesman/chansrv/devredir.c b/sesman/chansrv/devredir.c index cdcc9e94..9b746a98 100644 --- a/sesman/chansrv/devredir.c +++ b/sesman/chansrv/devredir.c @@ -879,7 +879,7 @@ dev_redir_proc_query_dir_response(IRP *irp, tui32 IoStatus) { FUSE_DATA *fuse_data = NULL; - XRDP_INODE *xinode = NULL; + XRDP_INODE *xinode; tui32 Length; tui32 NextEntryOffset; @@ -1017,6 +1017,7 @@ dev_redir_get_dir_listing(void *fusep, tui32 device_id, char *path) irp->CompletionId = g_completion_id++; irp->completion_type = CID_CREATE_DIR_REQ; irp->DeviceId = device_id; + strcpy(irp->pathname, path); devredir_fuse_data_enqueue(irp, fusep); @@ -1069,6 +1070,7 @@ dev_redir_file_open(void *fusep, tui32 device_id, char *path, irp->CompletionId = g_completion_id++; irp->DeviceId = device_id; + strcpy(irp->pathname, path); devredir_fuse_data_enqueue(irp, fusep); @@ -1174,6 +1176,7 @@ devredir_rmdir_or_file(void *fusep, tui32 device_id, char *path, int mode) irp->CompletionId = g_completion_id++; irp->completion_type = CID_RMDIR_OR_FILE; irp->DeviceId = device_id; + strcpy(irp->pathname, path); devredir_fuse_data_enqueue(irp, fusep); @@ -1216,6 +1219,7 @@ devredir_file_read(void *fusep, tui32 DeviceId, tui32 FileId, { log_error("no IRP found with FileId = %d", FileId); xfuse_devredir_cb_read_file(fusep, NULL, 0); + xstream_free(s); return -1; } @@ -1224,6 +1228,7 @@ devredir_file_read(void *fusep, tui32 DeviceId, tui32 FileId, { /* system out of memory */ xfuse_devredir_cb_read_file(fusep, NULL, 0); + xstream_free(s); return -1; } new_irp->FileId = 0; @@ -1268,6 +1273,7 @@ dev_redir_file_write(void *fusep, tui32 DeviceId, tui32 FileId, { log_error("no IRP found with FileId = %d", FileId); xfuse_devredir_cb_write_file(fusep, NULL, 0); + xstream_free(s); return -1; } @@ -1276,6 +1282,7 @@ dev_redir_file_write(void *fusep, tui32 DeviceId, tui32 FileId, { /* system out of memory */ xfuse_devredir_cb_write_file(fusep, NULL, 0); + xstream_free(s); return -1; } new_irp->FileId = 0; diff --git a/sesman/chansrv/rail.c b/sesman/chansrv/rail.c index 4888d2e0..4d620c00 100644 --- a/sesman/chansrv/rail.c +++ b/sesman/chansrv/rail.c @@ -1254,6 +1254,7 @@ rail_win_send_text(Window win) else { LOG(0, ("chansrv::rail_win_send_text: error rail_get_window_data_safe failed")); + g_free(data); return 1; } if (data && len > 0) diff --git a/sesman/chansrv/smartcard.c b/sesman/chansrv/smartcard.c index 0d6d5405..a07e36eb 100644 --- a/sesman/chansrv/smartcard.c +++ b/sesman/chansrv/smartcard.c @@ -861,11 +861,6 @@ scard_make_new_ioctl(IRP *irp, tui32 ioctl) struct stream *s; xstream_new(s, 1024 * 4); - if (s == NULL) - { - log_error("system out of memory"); - return s; - } devredir_insert_DeviceIoRequest(s, irp->DeviceId, diff --git a/sesman/chansrv/smartcard_pcsc.c b/sesman/chansrv/smartcard_pcsc.c index 1d1618dc..9824432e 100644 --- a/sesman/chansrv/smartcard_pcsc.c +++ b/sesman/chansrv/smartcard_pcsc.c @@ -603,6 +603,7 @@ scard_process_list_readers(struct trans *con, struct stream *in_s) { LLOGLN(0, ("scard_process_list_readers: " "get_pcsc_context_by_app_context failed")); + g_free(groups); return 1; } pcscListReaders = g_malloc(sizeof(struct pcsc_list_readers), 1); @@ -1489,6 +1490,7 @@ scard_process_get_status_change(struct trans *con, struct stream *in_s) { LLOGLN(0, ("scard_process_get_status_change: " "get_pcsc_context_by_app_context failed")); + g_free(rsa); return 1; } scard_send_get_status_change(user_data, diff --git a/sesman/chansrv/sound.c b/sesman/chansrv/sound.c index cc64a558..a90bf905 100644 --- a/sesman/chansrv/sound.c +++ b/sesman/chansrv/sound.c @@ -1189,7 +1189,6 @@ sound_sndsrvr_source_data_in(struct trans *trans) s_mark_end(s); trans_force_write_s(trans, s); - xstream_free(s); } else if (cmd == PA_CMD_START_REC) { @@ -1200,5 +1199,7 @@ sound_sndsrvr_source_data_in(struct trans *trans) sound_input_stop_recording(); } + xstream_free(s); + return 0; } |