Browse Source

core: fix double free on clearing lump

Dragos Oancea 9 years ago
parent
commit
c1ea48cfe3
1 changed files with 4 additions and 1 deletions
  1. 4 1
      data_lump_rpl.c

+ 4 - 1
data_lump_rpl.c

@@ -102,9 +102,12 @@ void free_lump_rpl(struct lump_rpl* lump)
 {
 {
 	if (lump) {
 	if (lump) {
 		if (!((lump->flags)&LUMP_RPL_NOFREE) && ((lump->flags)&LUMP_RPL_NODUP)
 		if (!((lump->flags)&LUMP_RPL_NOFREE) && ((lump->flags)&LUMP_RPL_NODUP)
-		&& lump->text.s)
+		&& lump->text.s) {
 			pkg_free(lump->text.s);
 			pkg_free(lump->text.s);
+			lump->text.s = 0;
+		}
 		pkg_free(lump);
 		pkg_free(lump);
+		lump = 0;
 	}
 	}
 }
 }