[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] Fix swapped calloc() arguments.
# HG changeset patch # User kaf24@xxxxxxxxxxxxxxxxxxxx # Node ID 123ff1c707285479f76af8d19f457a5d49fe2aff # Parent 5765497cf75e7b519ccbc255b4657d854907e2db Fix swapped calloc() arguments. Signed-off-by: Hollis Blanchard <hollisb@xxxxxxxxxx> diff -r 5765497cf75e -r 123ff1c70728 tools/ioemu/keyboard_rdesktop.c --- a/tools/ioemu/keyboard_rdesktop.c Wed Apr 19 18:38:14 2006 +0100 +++ b/tools/ioemu/keyboard_rdesktop.c Wed Apr 19 18:39:36 2006 +0100 @@ -75,7 +75,7 @@ static kbd_layout_t* parse_keyboard_layo char* file_name=malloc(strlen(prefix)+strlen(language)+strlen(bios_dir)+1); if(!k) - k=calloc(sizeof(kbd_layout_t),1); + k=calloc(1, sizeof(kbd_layout_t)); strcpy(file_name,bios_dir); strcat(file_name,prefix); strcat(file_name,language); diff -r 5765497cf75e -r 123ff1c70728 tools/libxc/xc_linux_restore.c --- a/tools/libxc/xc_linux_restore.c Wed Apr 19 18:38:14 2006 +0100 +++ b/tools/libxc/xc_linux_restore.c Wed Apr 19 18:39:36 2006 +0100 @@ -183,9 +183,9 @@ int xc_linux_restore(int xc_handle, int /* We want zeroed memory so use calloc rather than malloc. */ - p2m = calloc(sizeof(unsigned long), max_pfn); - pfn_type = calloc(sizeof(unsigned long), max_pfn); - region_mfn = calloc(sizeof(unsigned long), MAX_BATCH_SIZE); + p2m = calloc(max_pfn, sizeof(unsigned long)); + pfn_type = calloc(max_pfn, sizeof(unsigned long)); + region_mfn = calloc(MAX_BATCH_SIZE, sizeof(unsigned long)); if ((p2m == NULL) || (pfn_type == NULL) || (region_mfn == NULL)) { ERR("memory alloc failed"); _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |