Fixes to Coverity issues 77197 (mysql_common.c, dcb.c, mysql_client.c, skygw_debug.h), 72654 (poll.c), 72756 (mysql_backend.c), 72744 (mysql_backend.c), 77197 (mysql_common.c), 72746 (mysql_common.c), 72676 (mysql_common.c), 72705 (readwritesplit.c), 72697 (readwritesplit.c), 72652 (skygw_debug.h)

This commit is contained in:
VilhoRaatikka
2014-11-11 14:10:06 +02:00
parent 704c69eb40
commit 061fa62d29
7 changed files with 138 additions and 114 deletions

View File

@ -509,10 +509,14 @@ bool succp = false;
pthread_self(),
dcb->fd,
dcb)));
#endif /* SS_DEBUG */
#if defined(FAKE_CODE)
conn_open[dcb->fd] = false;
#endif /* FAKE_CODE */
#if defined(SS_DEBUG)
ss_debug(dcb->fd = -1;)
}
#endif
#endif /* SS_DEBUG */
succp = dcb_set_state(dcb, DCB_STATE_DISCONNECTED, NULL);
ss_dassert(succp);
dcb_next = dcb->memdata.next;

View File

@ -1073,13 +1073,26 @@ double avg1 = 0.0, avg5 = 0.0, avg15 = 0.0;
{
char *event_string
= event_to_string(thread_data[i].event);
bool from_heap;
if (event_string == NULL)
{
from_heap = false;
event_string = "??";
}
else
{
from_heap = true;
}
dcb_printf(dcb,
" %2d | %-10s | %6d | %-16p | %s\n",
i, state, thread_data[i].n_fds,
thread_data[i].cur_dcb, event_string);
free(event_string);
if (from_heap)
{
free(event_string);
}
}
}
}