Module: kamailio
Branch: master
Commit: 13bb3732aff23abbb1ba1114f1697095c09d584c
URL: 
https://github.com/kamailio/kamailio/commit/13bb3732aff23abbb1ba1114f1697095c09d584c

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2018-09-17T11:45:15+02:00

htable: use proper variable to set the expire along with the value

---

Modified: src/modules/htable/ht_api.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/13bb3732aff23abbb1ba1114f1697095c09d584c.diff
Patch: 
https://github.com/kamailio/kamailio/commit/13bb3732aff23abbb1ba1114f1697095c09d584c.patch

---

diff --git a/src/modules/htable/ht_api.c b/src/modules/htable/ht_api.c
index 7f4298c10b..1c82e9c7ea 100644
--- a/src/modules/htable/ht_api.c
+++ b/src/modules/htable/ht_api.c
@@ -597,8 +597,7 @@ int ht_set_cell_ex(ht_t *ht, str *name, int type, int_str 
*val, int mode,
        }
        /* add */
        cell = ht_cell_new(name, type, val, hid);
-       if(cell == NULL)
-       {
+       if(cell == NULL) {
                LM_ERR("cannot create new cell.\n");
                if(mode) ht_slot_unlock(ht, idx);
                return -1;
@@ -606,12 +605,10 @@ int ht_set_cell_ex(ht_t *ht, str *name, int type, int_str 
*val, int mode,
        if(exv<=0) {
                cell->expire = now + ht->htexpire;
        } else {
-               it->expire = now + exv;
+               cell->expire = now + exv;
        }
-       if(prev==NULL)
-       {
-               if(ht->entries[idx].first!=NULL)
-               {
+       if(prev==NULL) {
+               if(ht->entries[idx].first!=NULL) {
                        cell->next = ht->entries[idx].first;
                        ht->entries[idx].first->prev = cell;
                }


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to