[sr-dev] git:master:c1ea48cf: core: fix double free on clearing lump

Dragos Oancea dragos.oancea at athonet.com
Mon Aug 22 13:25:49 CEST 2016


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

Author: Dragos Oancea <dragos.oancea at athonet.com>
Committer: Dragos Oancea <dragos.oancea at athonet.com>
Date: 2016-08-22T09:58:48+02:00

core: fix double free on clearing lump

---

Modified: data_lump_rpl.c

---

Diff:  https://github.com/kamailio/kamailio/commit/c1ea48cfe38e6c52c50e6f1d698254a789e988f1.diff
Patch: https://github.com/kamailio/kamailio/commit/c1ea48cfe38e6c52c50e6f1d698254a789e988f1.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;
 	}
 }
 




More information about the sr-dev mailing list