Skip to content

Commit

Permalink
Fix oss-fuzz 68319
Browse files Browse the repository at this point in the history
Regression in unreleased code.
  • Loading branch information
ralight committed Apr 27, 2024
1 parent db6ab68 commit ac26467
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ static int config__add_listener(struct mosquitto__config *config)
}
}
}
config->listener_count++;
config->listeners = mosquitto_realloc(config->listeners, sizeof(struct mosquitto__listener)*(size_t)config->listener_count);
config->listeners = mosquitto_realloc(config->listeners, sizeof(struct mosquitto__listener)*(size_t)(config->listener_count+1));
if(!config->listeners){
log__printf(NULL, MOSQ_LOG_ERR, "Error: Out of memory.");
return MOSQ_ERR_NOMEM;
Expand All @@ -168,6 +167,7 @@ static int config__add_listener(struct mosquitto__config *config)
if(def_listener != -1){
config->default_listener = &config->listeners[def_listener];
}
config->listener_count++;

return MOSQ_ERR_SUCCESS;
}
Expand Down

0 comments on commit ac26467

Please sign in to comment.