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

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2017-05-15T14:11:57+02:00

core: reset avps and xavps lists in all error cases

- just for safety when one uses some srevent routes

---

Modified: src/core/receive.c

---

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

---

diff --git a/src/core/receive.c b/src/core/receive.c
index 18d244c..3a863be 100644
--- a/src/core/receive.c
+++ b/src/core/receive.c
@@ -381,10 +381,6 @@ int receive_msg(char* buf, unsigned int len, struct 
receive_info* rcv_info)
 error_rpl:
        /* execute post reply-script callbacks */
        exec_post_script_cb(msg, ONREPLY_CB_TYPE);
-       reset_avps();
-#ifdef WITH_XAVP
-       xavp_reset_list();
-#endif
        goto error02;
 #endif /* NO_ONREPLY_ROUTE_ERROR */
 error_req:
@@ -392,15 +388,14 @@ int receive_msg(char* buf, unsigned int len, struct 
receive_info* rcv_info)
        /* execute post request-script callbacks */
        exec_post_script_cb(msg, REQUEST_CB_TYPE);
 error03:
-       /* free possible loaded avps -bogdan */
-       reset_avps();
-#ifdef WITH_XAVP
-       xavp_reset_list();
-#endif
 error02:
        free_sip_msg(msg);
        pkg_free(msg);
 error00:
+       reset_avps();
+#ifdef WITH_XAVP
+       xavp_reset_list();
+#endif
        STATS_RX_DROPS;
        /* reset log prefix */
        log_prefix_set(NULL);


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

Reply via email to