topos_redis: fix regression in PRACK routing (commit cfc89db53c087, GH #1784)
authorHenning Westerholt <hw@skalatan.de>
Thu, 15 Aug 2019 14:25:57 +0000 (16:25 +0200)
committerHenning Westerholt <hw@skalatan.de>
Thu, 15 Aug 2019 14:25:57 +0000 (16:25 +0200)
- fix regression in PRACK routing (introduced in cfc89db53c, GH #1784)
- result set were set to 0 before usage by a memset

src/modules/topos_redis/topos_redis_storage.c

index 3cc24ef..fe36640 100644 (file)
@@ -727,6 +727,7 @@ int tps_redis_load_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd,
        memset(argv, 0, TPS_REDIS_NR_KEYS * sizeof(char*));
        memset(argvlen, 0, TPS_REDIS_NR_KEYS * sizeof(size_t));
        argc = 0;
+       memset(&id, 0, sizeof(tps_data_t));
 
        if(mode==0) {
                /* load same transaction using Via branch */
@@ -737,7 +738,6 @@ int tps_redis_load_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd,
                        LM_ERR("failed to load the INVITE branch value\n");
                        return -1;
                }
-               memset(&id, 0, sizeof(tps_data_t));
                xvbranch1 = &id.x_vbranch1;
        }
        if(xvbranch1->len<=0 || xvbranch1->s==NULL) {