Fixes to Coverity defects
Few fixes to possible use of freed memory and resource leaks.
This commit is contained in:
@ -156,6 +156,7 @@ MAXINFO_TREE *col, *table;
|
||||
{
|
||||
/** Unknown token after RESTART MONITOR|SERVICE */
|
||||
*parse_error = PARSE_SYNTAX_ERROR;
|
||||
free(text);
|
||||
free_tree(tree);
|
||||
return NULL;
|
||||
}
|
||||
@ -376,7 +377,10 @@ int i;
|
||||
}
|
||||
|
||||
if (s1 == s2)
|
||||
{
|
||||
*text = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*text = strndup(s1, s2 - s1);
|
||||
for (i = 0; keywords[i].text; i++)
|
||||
|
@ -1254,7 +1254,7 @@ static void* newSession(
|
||||
if(db[0] != 0x0)
|
||||
{
|
||||
/* Store the database the client is connecting to */
|
||||
strncpy(client_rses->connect_db,db,MYSQL_DATABASE_MAXLEN+1);
|
||||
snprintf(client_rses->connect_db, MYSQL_DATABASE_MAXLEN + 1, "%s", db);
|
||||
}
|
||||
|
||||
|
||||
@ -3797,7 +3797,7 @@ static bool route_session_write(
|
||||
unsigned char packet_type,
|
||||
skygw_query_type_t qtype)
|
||||
{
|
||||
bool succp;
|
||||
bool succp = false;
|
||||
rses_property_t* prop;
|
||||
backend_ref_t* backend_ref;
|
||||
int i;
|
||||
|
@ -1497,7 +1497,7 @@ gen_show_dbs_response(ROUTER_INSTANCE* router, ROUTER_CLIENT_SES* client)
|
||||
rval = gwbuf_append(rval, last_packet);
|
||||
|
||||
rval = gwbuf_make_contiguous(rval);
|
||||
|
||||
hashtable_iterator_free(iter);
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user