Browse code

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 authored on 13/10/2009 18:11:25
Showing 1 changed files
... ...
@@ -1189,7 +1189,7 @@ void fparam_free_contents(fparam_t* fp)
1189 1189
 		case FPARAM_INT:
1190 1190
 		case FPARAM_STR:
1191 1191
 			/* nothing to do */
1192
-			return;
1192
+			break;
1193 1193
 		case FPARAM_REGEX:
1194 1194
 			if (fp->v.regex){
1195 1195
 				regfree(fp->v.regex);
... ...
@@ -1225,6 +1225,10 @@ void fparam_free_contents(fparam_t* fp)
1225 1225
 			}
1226 1226
 			break;
1227 1227
 	}
1228
+	if (fp->orig){
1229
+		pkg_free(fp->orig);
1230
+		fp->orig=0;
1231
+	}
1228 1232
 }
1229 1233
 
1230 1234