summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2013-01-16 18:37:23 +0100
committerBlue Swirl <blauwirbel@gmail.com>2013-01-19 10:24:43 +0000
commite4ada482420175bc17d6ccb9f2af0e769da78e01 (patch)
tree957c6756ff906ba4a5927479e714228512df7e1b /exec.c
parent0e7a75929353b04bd2fce1be8640226883b42a10 (diff)
Replace non-portable asprintf by g_strdup_printf
g_strdup_printf already handles OOM errors, so some error handling in QEMU code can be removed. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/exec.c b/exec.c
index 5689613d0a..b85508ba30 100644
--- a/exec.c
+++ b/exec.c
@@ -863,18 +863,16 @@ static void *file_ram_alloc(RAMBlock *block,
return NULL;
}
- if (asprintf(&filename, "%s/qemu_back_mem.XXXXXX", path) == -1) {
- return NULL;
- }
+ filename = g_strdup_printf("%s/qemu_back_mem.XXXXXX", path);
fd = mkstemp(filename);
if (fd < 0) {
perror("unable to create backing store for hugepages");
- free(filename);
+ g_free(filename);
return NULL;
}
unlink(filename);
- free(filename);
+ g_free(filename);
memory = (memory+hpagesize-1) & ~(hpagesize-1);