Further Coverity Scan fixes.

pull/766/merge
Roger A. Light 8 years ago
parent dbdd113c86
commit d09d7c47c5

@ -722,6 +722,7 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, const
return MOSQ_ERR_NOMEM;
}else if(STREMPTY(key)){
log__printf(NULL, MOSQ_LOG_ERR, "Error: Invalid auth_opt_ config option.");
mosquitto__free(key);
return MOSQ_ERR_INVAL;
}
token += 9+strlen(key)+1;
@ -733,6 +734,7 @@ int config__read_file_core(struct mosquitto__config *config, bool reload, const
cur_auth_plugin_config->options = mosquitto__realloc(cur_auth_plugin_config->options, cur_auth_plugin_config->option_count*sizeof(struct mosquitto_auth_opt));
if(!cur_auth_plugin_config->options){
log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory.");
mosquitto__free(key);
return MOSQ_ERR_NOMEM;
}
cur_auth_plugin_config->options[cur_auth_plugin_config->option_count-1].key = key;

@ -124,7 +124,9 @@ int net__socket_accept(struct mosquitto_db *db, mosq_sock_t listensock)
if(db->config->set_tcp_nodelay){
int flag = 1;
setsockopt(new_sock, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int));
if(setsockopt(new_sock, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int) != 0)){
log__printf(NULL, MOSQ_LOG_WARNING, "Warning: Unable to set TCP_NODELAY.");
}
}
new_context = context__init(db, new_sock);

Loading…
Cancel
Save