linux-user: replace calloc() with g_new0()
PATCH 1/1 linux-user: replace calloc() with g_new0()
Use glib allocation as recommended by the coding convention
Signed-off-by Nguyen Dinh Phi <[email protected]>
--- linux-user/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
linux-user/main.c +1 -5
@@ -928,11 +928,7 @@ int main(int argc, char **argv, char **envp)* Prepare copy of argv vector for target. */ target_argc = argc - optind; - target_argv =calloc (target_argc +1 ,sizeof (char *)); -if (target_argv ==NULL ) { - (void )fprintf (stderr,"Unable to allocate memory for target_argv\n" ); -exit (EXIT_FAILURE ); - } + target_argv = g_new0(char *, target_argc + 1);/* * If argv0 is specified (using '-0' switch) we replace
Signature · 1 line
2.34.1
Quoted 12 lines · Nguyen Dinh Phi
Use glib allocation as recommended by the coding convention
Signed-off-by Nguyen Dinh Phi <[email protected]>--- linux-user/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)linux-user/main.c +0
-0
linux-user/main.c int main(int argc, char **argv, char **envp) · line 931
Quoted 9 lines
linux-user/main.c +1
-5@@ -928,11 +928,7 @@ int main(int argc, char **argv, char **envp)* Prepare copy of argv vector for target. */ target_argc = argc - optind; - target_argv =calloc (target_argc +1 ,sizeof (char *)); -if (target_argv ==NULL ) { - (void )fprintf (stderr,"Unable to allocate memory for target_argv\n" ); -exit (EXIT_FAILURE ); - } + target_argv = g_new0(char *, target_argc + 1);
Reviewed-by Alex Bennée <[email protected]>
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro
Richard Henderson
AppliedQuoted 14 lines · Nguyen Dinh Phi
Use glib allocation as recommended by the coding convention
Signed-off-by Nguyen Dinh Phi <[email protected]>--- linux-user/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)linux-user/main.c +0
-0@@ -928,11 +928,7 @@ int main(int argc, char **argv, char **envp)* Prepare copy of argv vector for target. */
linux-user/main.c int main(int argc, char **argv, char **envp) · line 934
Quoted 10 lines
linux-user/main.c +1
-5target_argc = argc - optind; - target_argv =calloc (target_argc +1 ,sizeof (char *)); -if (target_argv ==NULL ) { - (void )fprintf (stderr,"Unable to allocate memory for target_argv\n" ); -exit (EXIT_FAILURE ); - } + target_argv = g_new0(char *, target_argc + 1);/* * If argv0 is specified (using '-0' switch) we replace
Queued, thanks.
r~