From: Fabio Erculiani Date: Tue, 3 Jan 2012 09:38:35 +0000 (+0000) Subject: linux-user: target_argv is placed on ts->bprm->argv and can't be freed() X-Git-Tag: v1.1-rc0~138^2~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84803b87a183bd71963584c3be5ca838d32c55df;p=thirdparty%2Fqemu.git linux-user: target_argv is placed on ts->bprm->argv and can't be freed() TaskState contains linux_bprm struct which encapsulates argv among other things. argv might be used around the code and is expected to contain valid data. Before this patch, ts->bprm->argv was NULL due to it being freed right after loader_exec(). Signed-off-by: Fabio Erculiani Acked-by: Alexander Graf Signed-off-by: Alexander Graf Signed-off-by: Riku Voipio --- diff --git a/linux-user/main.c b/linux-user/main.c index 962677e01d3..25701403e40 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3486,11 +3486,6 @@ int main(int argc, char **argv, char **envp) _exit(1); } - for (i = 0; i < target_argc; i++) { - free(target_argv[i]); - } - free(target_argv); - for (wrk = target_environ; *wrk; wrk++) { free(*wrk); }