Fixes to Coverity defects.
This commit is contained in:
@ -73,7 +73,6 @@ MONITOR *mon;
|
|||||||
LOGFILE_ERROR,
|
LOGFILE_ERROR,
|
||||||
"Error : Unable to load monitor module '%s'.",
|
"Error : Unable to load monitor module '%s'.",
|
||||||
name)));
|
name)));
|
||||||
free(mon->name);
|
|
||||||
free(mon);
|
free(mon);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,8 +229,9 @@ void mon_append_node_names(MONITOR_SERVERS* start,char* str, int len)
|
|||||||
{
|
{
|
||||||
MONITOR_SERVERS* ptr = start;
|
MONITOR_SERVERS* ptr = start;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
|
int slen = strlen(str);
|
||||||
|
|
||||||
while(ptr)
|
while(ptr && slen < len)
|
||||||
{
|
{
|
||||||
if(!first)
|
if(!first)
|
||||||
{
|
{
|
||||||
@ -239,6 +240,7 @@ void mon_append_node_names(MONITOR_SERVERS* start,char* str, int len)
|
|||||||
first = false;
|
first = false;
|
||||||
strncat(str,ptr->server->unique_name,len);
|
strncat(str,ptr->server->unique_name,len);
|
||||||
ptr = ptr->next;
|
ptr = ptr->next;
|
||||||
|
slen = strlen(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -123,6 +123,8 @@ startMonitor(void *arg,void* opt)
|
|||||||
return NULL;
|
return NULL;
|
||||||
handle->shutdown = 0;
|
handle->shutdown = 0;
|
||||||
handle->id = MONITOR_DEFAULT_ID;
|
handle->id = MONITOR_DEFAULT_ID;
|
||||||
|
handle->script = NULL;
|
||||||
|
handle->master = NULL;
|
||||||
memset(handle->events,false,sizeof(handle->events));
|
memset(handle->events,false,sizeof(handle->events));
|
||||||
spinlock_init(&handle->lock);
|
spinlock_init(&handle->lock);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user