[sr-dev] git:5.3:33a3640a: avpops: free fname1 in case of error getting fname2

Daniel-Constantin Mierla miconda at gmail.com
Thu Jul 2 09:55:45 CEST 2020


Module: kamailio
Branch: 5.3
Commit: 33a3640af730bcd674efc2b55b643bd406d08749
URL: https://github.com/kamailio/kamailio/commit/33a3640af730bcd674efc2b55b643bd406d08749

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2020-07-02T09:42:39+02:00

avpops: free fname1 in case of error getting fname2

(cherry picked from commit fbc55950c8ac0c34c5b6693c1578de7cd11b484c)

---

Modified: src/modules/avpops/avpops.c

---

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

---

diff --git a/src/modules/avpops/avpops.c b/src/modules/avpops/avpops.c
index 6e49933e8a..d98167547d 100644
--- a/src/modules/avpops/avpops.c
+++ b/src/modules/avpops/avpops.c
@@ -1158,6 +1158,7 @@ static int ki_copy_avps(struct sip_msg* msg, str *name1, str *name2)
 	if((fname2 = avpops_parse_pvar(name2->s)) == NULL)
 	{
 		LM_ERR("unable to get pseudo-variable in param 2\n");
+		pkg_free(fname1);
 		return E_OUT_OF_MEM;
 	}
 	/* attr name is mandatory */
@@ -1225,4 +1226,4 @@ static sr_kemi_t sr_kemi_rtpengine_exports[] = {
 int mod_register(char *path, int *dlflags, void *p1, void *p2) {
     sr_kemi_modules_add(sr_kemi_rtpengine_exports);
     return 0;
-}
\ No newline at end of file
+}




More information about the sr-dev mailing list