[sr-dev] git:master:e34ecb39: Merge pull request #753 from athonet-open/fix__dbl_frees

GitHub noreply at github.com
Mon Aug 22 13:25:50 CEST 2016


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

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: GitHub <noreply at github.com>
Date: 2016-08-22T13:25:45+02:00

Merge pull request #753 from athonet-open/fix__dbl_frees

core: fixed two double free() situations

---

Modified: data_lump_rpl.c
Modified: parser/hf.c

---

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

---

diff --git a/data_lump_rpl.c b/data_lump_rpl.c
index 6ce77f8..6b8ba8d 100644
--- a/data_lump_rpl.c
+++ b/data_lump_rpl.c
@@ -102,9 +102,12 @@ void free_lump_rpl(struct lump_rpl* lump)
 {
 	if (lump) {
 		if (!((lump->flags)&LUMP_RPL_NOFREE) && ((lump->flags)&LUMP_RPL_NODUP)
-		&& lump->text.s)
+		&& lump->text.s) {
 			pkg_free(lump->text.s);
+			lump->text.s = 0;
+		}
 		pkg_free(lump);
+		lump = 0;
 	}
 }
 
diff --git a/parser/hf.c b/parser/hf.c
index 2ff94d0..4b82fbe 100644
--- a/parser/hf.c
+++ b/parser/hf.c
@@ -215,6 +215,7 @@ void free_hdr_field_lst(struct hdr_field* hf)
 		hf=hf->next;
 		clean_hdr_field(foo);
 		pkg_free(foo);
+		foo = 0;
 	}
 }
 




More information about the sr-dev mailing list