Fixes to Coverity errors:

72747
75940
75941
73408
75425
This commit is contained in:
Markus Makela
2014-11-07 10:57:11 +02:00
parent 4f39828fa1
commit e1af60ac71
5 changed files with 21 additions and 6 deletions

View File

@ -302,7 +302,7 @@ routeQuery(FILTER *instance, void *session, GWBUF *queue)
REGEX_INSTANCE *my_instance = (REGEX_INSTANCE *)instance;
REGEX_SESSION *my_session = (REGEX_SESSION *)session;
char *sql, *newsql;
int length;
int length = 0;
if (modutil_is_SQL(queue))
{

View File

@ -415,6 +415,7 @@ GWBUF *clone = NULL;
modutil_MySQL_Query(queue, &dummy, &length, &residual);
clone = gwbuf_clone(queue);
my_session->residual = residual;
free(ptr);
}
}

View File

@ -303,7 +303,7 @@ int load_query()
int i, qcount = 0, qbuff_sz = 10, rval = 0;
int offset = 0;
unsigned int qlen = 0;
buffer = (char*)malloc(4092*sizeof(char));
buffer = (char*)calloc(4092,sizeof(char));
if(buffer == NULL){
printf("Error: cannot allocate enough memory.\n");
skygw_log_write(LOGFILE_ERROR,"Error: cannot allocate enough memory.\n");