diff options
author | Anthony PERARD <anthony.perard@citrix.com> | 2012-10-05 14:34:30 +0100 |
---|---|---|
committer | Anthony PERARD <anthony.perard@citrix.com> | 2012-10-05 14:34:30 +0100 |
commit | 5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd (patch) | |
tree | 74ef7377424cc78bfe25429e3a9c7b047a5cd3b7 /tools/libxl/libxl_json.c | |
parent | 3c8ec17b26e686a6601e1a678c090f44464ad514 (diff) | |
download | xen-5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd.tar.gz xen-5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd.tar.bz2 xen-5fe37ba9c6b6658ed7980f81f8374acd6e2f3bbd.zip |
libxl: Have flexarray using the GC
This patch makes the flexarray function libxl__gc aware.
It also updates every function that use a flexarray to pass the gc and removes
every memory allocation check and free.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/libxl/libxl_json.c')
-rw-r--r-- | tools/libxl/libxl_json.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c index 8e17842e41..2e6322bfa1 100644 --- a/tools/libxl/libxl_json.c +++ b/tools/libxl/libxl_json.c @@ -220,13 +220,7 @@ static libxl__json_object *json_object_alloc(libxl__gc *gc, obj->type = type; if (type == JSON_MAP || type == JSON_ARRAY) { - flexarray_t *array = flexarray_make(1, 1); - if (array == NULL) { - LIBXL__LOG_ERRNO(libxl__gc_owner(gc), LIBXL__LOG_ERROR, - "Failed to allocate a flexarray"); - free(obj); - return NULL; - } + flexarray_t *array = flexarray_make(NOGC, 1, 1); if (type == JSON_MAP) obj->u.map = array; else |