Check for NULL before strcmp.
This commit is contained in:
parent
7b614b3b59
commit
9e5b850181
@ -453,7 +453,7 @@ int db__message_insert(struct mosquitto *context, uint16_t mid, enum mosquitto_m
|
|||||||
&& dir == mosq_md_out && retain == false && stored->dest_ids){
|
&& dir == mosq_md_out && retain == false && stored->dest_ids){
|
||||||
|
|
||||||
for(i=0; i<stored->dest_id_count; i++){
|
for(i=0; i<stored->dest_id_count; i++){
|
||||||
if(!strcmp(stored->dest_ids[i], context->id)){
|
if(stored->dest_ids[i] && !strcmp(stored->dest_ids[i], context->id)){
|
||||||
/* We have already sent this message to this client. */
|
/* We have already sent this message to this client. */
|
||||||
mosquitto_property_free_all(&properties);
|
mosquitto_property_free_all(&properties);
|
||||||
return MOSQ_ERR_SUCCESS;
|
return MOSQ_ERR_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user