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

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2025-02-13T11:45:06+01:00

pv: free next field on error when parsing xav* names

---

Modified: src/modules/pv/pv_xavp.c

---

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

---

diff --git a/src/modules/pv/pv_xavp.c b/src/modules/pv/pv_xavp.c
index 89d9ba131d0..8858c376367 100644
--- a/src/modules/pv/pv_xavp.c
+++ b/src/modules/pv/pv_xavp.c
@@ -516,6 +516,10 @@ int pv_parse_xavp_name(pv_spec_p sp, str *in)
 
 error:
        if(xname != NULL) {
+               if(xname->next != NULL) {
+                       pkg_free(xname->next);
+                       xname->next = NULL;
+               }
                pv_xavp_name_destroy(xname);
                pkg_free(xname);
        }
@@ -964,6 +968,10 @@ int pv_parse_xavu_name(pv_spec_t *sp, str *in)
 
 error:
        if(xname != NULL) {
+               if(xname->next != NULL) {
+                       pkg_free(xname->next);
+                       xname->next = NULL;
+               }
                pv_xavu_name_destroy(xname);
                pkg_free(xname);
        }
@@ -1111,6 +1119,10 @@ int pv_parse_xavi_name(pv_spec_p sp, str *in)
 
 error:
        if(xname != NULL) {
+               if(xname->next != NULL) {
+                       pkg_free(xname->next);
+                       xname->next = NULL;
+               }
                pv_xavi_name_destroy(xname);
                pkg_free(xname);
        }

_______________________________________________
Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to