diff --git a/src/conf.c b/src/conf.c index e182b5c4..e79b79b2 100644 --- a/src/conf.c +++ b/src/conf.c @@ -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; diff --git a/src/net.c b/src/net.c index a0f90b81..3e0e3bcc 100644 --- a/src/net.c +++ b/src/net.c @@ -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);