coverity: Dereference after null check

ulab-next-nosound
Laxmikant Rashinkar 11 years ago
parent a990287c46
commit 0c63a8feb3

@ -1781,6 +1781,8 @@ void xfuse_devredir_cb_rename_file(void *vp, tui32 IoStatus)
new_xinode = xfuse_get_inode_from_pinode_name(fip->new_inode,
fip->new_name);
if (new_xinode)
{
if (new_xinode->mode & S_IFREG)
xfuse_delete_file_with_xinode(new_xinode);
else
@ -1788,6 +1790,7 @@ void xfuse_devredir_cb_rename_file(void *vp, tui32 IoStatus)
new_xinode = NULL;
}
}
old_xinode = xfuse_get_inode_from_pinode_name(fip->inode, fip->name);
if (old_xinode == NULL)

@ -790,10 +790,14 @@ dev_redir_proc_device_iocompletion(struct stream *s)
fuse_data = devredir_fuse_data_dequeue(irp);
if (fuse_data == NULL)
{
log_error("fuse_data is NULL");
}
else
{
xfuse_devredir_cb_read_file(fuse_data->data_ptr, s->p, Length);
devredir_irp_delete(irp);
}
break;
case CID_WRITE:
@ -802,10 +806,14 @@ dev_redir_proc_device_iocompletion(struct stream *s)
fuse_data = devredir_fuse_data_dequeue(irp);
if (fuse_data == NULL)
{
log_error("fuse_data is NULL");
}
else
{
xfuse_devredir_cb_write_file(fuse_data->data_ptr, s->p, Length);
devredir_irp_delete(irp);
}
break;
case CID_CLOSE:

@ -739,7 +739,7 @@ rail_win_get_state(Window win)
(unsigned char **)&data,
&nitems);
if (data || nitems > 0)
if (data && nitems > 0)
{
rv = *(unsigned long *)data;
XFree(data);

@ -1764,7 +1764,6 @@ xrdp_bitmap_def_proc(struct xrdp_bitmap *self, int msg,
if (self->child_list != 0)
{
i = list_index_of(self->child_list, (long)self->focused_control);
}
if (shift)
{
@ -1823,6 +1822,7 @@ xrdp_bitmap_def_proc(struct xrdp_bitmap *self, int msg,
b = (struct xrdp_bitmap *)list_get_item(self->child_list, i);
}
}
}
else if (scan_code == 28) /* enter */
{
if (self->default_button != 0)

@ -60,13 +60,13 @@ init_xrdp_encoder(struct xrdp_mm *self)
char buf[1024];
int pid;
LLOGLN(0, ("init_xrdp_encoder: initing encoder codec_id %d", self->codec_id));
if (self == 0)
{
return -1;
}
LLOGLN(0, ("init_xrdp_encoder: initing encoder codec_id %d", self->codec_id));
/* setup required FIFOs */
self->fifo_to_proc = fifo_create();
self->fifo_processed = fifo_create();

@ -449,7 +449,7 @@ xrdp_listen_main_loop(struct xrdp_listen *self)
robjs[robjs_count++] = done_obj;
timeout = -1;
if (self->listen_trans != 0)
/* if (self->listen_trans != 0) */
{
if (trans_get_wait_objs(self->listen_trans, robjs,
&robjs_count) != 0)

@ -70,7 +70,6 @@ xrdp_process_loop(struct xrdp_process *self, struct stream *s)
if (self->session != 0)
{
rv = libxrdp_process_data(self->session, s);
}
if ((self->wm == 0) && (self->session->up_and_running) && (rv == 0))
{
@ -80,6 +79,7 @@ xrdp_process_loop(struct xrdp_process *self, struct stream *s)
zero and login_mode_event is set so xrdp_wm_init should be called by
xrdp_wm_check_wait_objs */
}
}
return rv;
}

@ -1745,13 +1745,13 @@ callback(long id, int msg, long param1, long param2, long param3, long param4)
static int APP_CC
xrdp_wm_login_mode_changed(struct xrdp_wm *self)
{
g_writeln("xrdp_wm_login_mode_changed: login_mode is %d", self->login_mode);
if (self == 0)
{
return 0;
}
g_writeln("xrdp_wm_login_mode_changed: login_mode is %d", self->login_mode);
if (self->login_mode == 0)
{
/* this is the inital state of the login window */

Loading…
Cancel
Save