Skip to content

Commit

Permalink
linux-user: replace calloc() with g_new0()
Browse files Browse the repository at this point in the history
Use glib allocation as recommended by the coding convention

Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
Message-Id: <20240317171747.1642207-1-phind.uet@gmail.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
ita93 authored and rth7680 committed Apr 9, 2024
1 parent f0907ff commit 2ee80bc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2ee80bc

Please sign in to comment.