projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve precision of the io_limit setting
[fio.git]
/
json.c
diff --git
a/json.c
b/json.c
index 7480a61fa98939519f3306fa583977fd8d331f40..6145ee489dbd2c6077dfa3a8913fa3935cc49c0c 100644
(file)
--- a/
json.c
+++ b/
json.c
@@
-8,18
+8,12
@@
struct json_object *json_create_object(void)
{
struct json_object *json_create_object(void)
{
- struct json_object *obj = malloc(sizeof(struct json_object));
- if (obj)
- memset(obj, 0, sizeof(struct json_object));
- return obj;
+ return calloc(1, sizeof(struct json_object));
}
struct json_array *json_create_array(void)
{
}
struct json_array *json_create_array(void)
{
- struct json_array *array = malloc(sizeof(struct json_array));
- if (array)
- memset(array, 0, sizeof(struct json_array));
- return array;
+ return calloc(1, sizeof(struct json_array));
}
static struct json_pair *json_create_pair(const char *name, struct json_value *value)
}
static struct json_pair *json_create_pair(const char *name, struct json_value *value)