mirror of
https://github.com/utmapp/qemu.git
synced 2026-12-01 22:23:23 -10:00
linux-user: replace calloc() with g_new0()
Use glib allocation as recommended by the coding convention Signed-off-by: Nguyen Dinh Phi <[email protected]> Message-Id: <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
This commit is contained in:
1 parent
f0907ff4ca
commit
2ee80bce4f
1 file changed
+1
-5
+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
|
||||
|
||||
Reference in new issue
Block a user