1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Remove some initialise-to-zero code.

This lets valgrind find more bugs - if a field isn't given a
well-defined value valgrind will now find it instead of seeing it
set to zero with memset.
This commit is contained in:
Stephen Dolan
2013-06-18 00:17:20 +01:00
parent 2c13f4fe72
commit 8c4d29ee38

View File

@@ -238,6 +238,7 @@ static void jq_reset(jq_state *jq) {
if (jv_get_kind(jq->path) != JV_KIND_INVALID)
jv_free(jq->path);
jq->path = jv_null();
jq->subexp_nest = 0;
}
@@ -660,9 +661,8 @@ jq_state *jq_init(void) {
jq = jv_mem_alloc_unguarded(sizeof(*jq));
if (jq == NULL)
return NULL;
memset(jq, 0, sizeof(*jq));
jq->debug_trace_enabled = 0;
jq->initial_execution = 1;
jq->bc = 0;
stack_init(&jq->stk);
jq->stk_top = 0;