coverity: Resource leak (2nd round)

ulab-next-nosound
Laxmikant Rashinkar 10 years ago
parent a9d7c13147
commit e4654b57ca

@ -215,7 +215,6 @@ scp_v1c_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (cmd != 42) if (cmd != 42)
{ {
g_free(ds);
return SCP_CLIENT_STATE_SEQUENCE_ERR; return SCP_CLIENT_STATE_SEQUENCE_ERR;
} }

@ -164,7 +164,6 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8)) if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, size - 8))
{ {
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__); log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: network error", __LINE__);
g_free(ds);
return SCP_CLIENT_STATE_NETWORK_ERR; return SCP_CLIENT_STATE_NETWORK_ERR;
} }
@ -181,7 +180,6 @@ scp_v1c_mng_get_session_list(struct SCP_CONNECTION *c, int *scount,
if (cmd != SCP_CMD_MNG_LIST) /* session list */ if (cmd != SCP_CMD_MNG_LIST) /* session list */
{ {
log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: sequence error", __LINE__); log_message(LOG_LEVEL_WARNING, "[v1c_mng:%d] connection aborted: sequence error", __LINE__);
g_free(ds);
return SCP_CLIENT_STATE_SEQUENCE_ERR; return SCP_CLIENT_STATE_SEQUENCE_ERR;
} }

@ -972,6 +972,8 @@ lib_mod_connect(struct vnc *v)
if (v->sck < 0) if (v->sck < 0)
{ {
v->server_msg(v, "VNC error: socket create error, g_tcp_socket() failed", 0); v->server_msg(v, "VNC error: socket create error, g_tcp_socket() failed", 0);
free_stream(s);
free_stream(pixel_format);
return 1; return 1;
} }

@ -413,7 +413,6 @@ xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, int *palette)
return 1; return 1;
} }
s = (struct stream *)NULL;
fd = g_file_open(filename); fd = g_file_open(filename);
if (fd != -1) if (fd != -1)
@ -445,6 +444,7 @@ xrdp_bitmap_load(struct xrdp_bitmap *self, const char *filename, int *palette)
{ {
log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s\n", log_message(LOG_LEVEL_ERROR, "xrdp_bitmap_load: seek error in file %s\n",
filename); filename);
free_stream(s);
g_file_close(fd); g_file_close(fd);
return 1; return 1;
} }

@ -462,6 +462,9 @@ xrdp_wm_login_fill_in_combo(struct xrdp_wm *self, struct xrdp_bitmap *b)
if (fd < 0) if (fd < 0)
{ {
log_message(LOG_LEVEL_ERROR, "Could not read xrdp ini file %s", cfg_file); log_message(LOG_LEVEL_ERROR, "Could not read xrdp ini file %s", cfg_file);
list_delete(sections);
list_delete(section_names);
list_delete(section_values);
return 1; return 1;
} }

@ -213,13 +213,19 @@ lib_mod_connect(struct mod *mod)
{ {
mod->sck = g_tcp_local_socket(); mod->sck = g_tcp_local_socket();
if (mod->sck < 0) if (mod->sck < 0)
{
free_stream(s);
return 1; return 1;
} }
}
else else
{ {
mod->sck = g_tcp_socket(); mod->sck = g_tcp_socket();
if (mod->sck < 0) if (mod->sck < 0)
{
free_stream(s);
return 1; return 1;
}
g_tcp_set_non_blocking(mod->sck); g_tcp_set_non_blocking(mod->sck);
g_tcp_set_no_delay(mod->sck); g_tcp_set_no_delay(mod->sck);

Loading…
Cancel
Save