|
|
@ -291,6 +291,7 @@ static int sub__add_normal(struct mosquitto *context, const char *sub, uint8_t q
|
|
|
|
return rc;
|
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(rc != MOSQ_ERR_SUB_EXISTS){
|
|
|
|
slen = strlen(sub);
|
|
|
|
slen = strlen(sub);
|
|
|
|
csub = mosquitto__calloc(1, sizeof(struct mosquitto__client_sub) + slen + 1);
|
|
|
|
csub = mosquitto__calloc(1, sizeof(struct mosquitto__client_sub) + slen + 1);
|
|
|
|
if(csub == NULL) return MOSQ_ERR_NOMEM;
|
|
|
|
if(csub == NULL) return MOSQ_ERR_NOMEM;
|
|
|
@ -298,7 +299,6 @@ static int sub__add_normal(struct mosquitto *context, const char *sub, uint8_t q
|
|
|
|
csub->hier = subhier;
|
|
|
|
csub->hier = subhier;
|
|
|
|
csub->shared = NULL;
|
|
|
|
csub->shared = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
if(rc != MOSQ_ERR_SUB_EXISTS){
|
|
|
|
|
|
|
|
for(i=0; i<context->sub_count; i++){
|
|
|
|
for(i=0; i<context->sub_count; i++){
|
|
|
|
if(!context->subs[i]){
|
|
|
|
if(!context->subs[i]){
|
|
|
|
context->subs[i] = csub;
|
|
|
|
context->subs[i] = csub;
|
|
|
|