Fixes to Coverity errors:

72662
72702
72724
73397
73410
73414
73422
75424
75748
75789
75938
75939

Also includes a fix to a bug caused by a previous Coverity error change in canonizer.c
This commit is contained in:
Markus Makela
2014-11-07 11:52:40 +02:00
parent 474f018cee
commit a4caac55c8
5 changed files with 57 additions and 55 deletions

View File

@ -1088,30 +1088,31 @@ char** skygw_get_table_names(GWBUF* querybuf,int* tblsize, bool fullnames)
}
}
if(tmp != NULL){
char *catnm = NULL;
char *catnm = NULL;
if(fullnames)
{
if(tbl->db && strcmp(tbl->db,"skygw_virtual") != 0)
{
catnm = (char*)calloc(strlen(tbl->db) + strlen(tbl->table_name) + 2,sizeof(char));
strcpy(catnm,tbl->db);
strcat(catnm,".");
strcat(catnm,tbl->table_name);
}
}
if(fullnames)
{
if(tbl->db && strcmp(tbl->db,"skygw_virtual") != 0)
{
catnm = (char*)calloc(strlen(tbl->db) + strlen(tbl->table_name) + 2,sizeof(char));
strcpy(catnm,tbl->db);
strcat(catnm,".");
strcat(catnm,tbl->table_name);
}
}
if(catnm)
{
tables[i++] = catnm;
}
else
{
tables[i++] = strdup(tbl->table_name);
}
if(catnm)
{
tables[i++] = catnm;
}
else
{
tables[i++] = strdup(tbl->table_name);
}
tbl=tbl->next_local;
tbl=tbl->next_local;
}
}
lex->current_select = lex->current_select->next_select_in_list();
}