Просмотр исходного кода

core: fix memleak in fixup_free*

fparam_free_contents() (which is what all the fixup_free* call in
sr) did not free the original string (which in sr is kept inside
 the fixed fparam/gparam).
It should have no impact, since at this point nobody seems to use
 any fixup_free* functions.
Andrei Pelinescu-Onciul 16 лет назад
Родитель
Сommit
af8f3e1536
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      sr_module.c

+ 5 - 1
sr_module.c

@@ -1189,7 +1189,7 @@ void fparam_free_contents(fparam_t* fp)
 		case FPARAM_INT:
 		case FPARAM_STR:
 			/* nothing to do */
-			return;
+			break;
 		case FPARAM_REGEX:
 			if (fp->v.regex){
 				regfree(fp->v.regex);
@@ -1225,6 +1225,10 @@ void fparam_free_contents(fparam_t* fp)
 			}
 			break;
 	}
+	if (fp->orig){
+		pkg_free(fp->orig);
+		fp->orig=0;
+	}
 }