equix: avoid a coverity warning in hashx_alloc()

This addresses one of the warnings in issue #40792. As far as I can tell
this is a false positive, since the use of "ctx->type" in hashx_free()
can only be hit after the unioned code/program pointer is non-NULL. It's
no big deal to zero this value explicitly to silence the warning though.

Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
This commit is contained in:
Micah Elizabeth Scott 2023-05-11 11:10:15 -07:00
parent e643a70879
commit c71b6a14a3

View File

@ -41,6 +41,7 @@ hashx_ctx* hashx_alloc(hashx_type type) {
goto failure; goto failure;
} }
ctx->code = NULL; ctx->code = NULL;
ctx->type = 0;
if (type & HASHX_COMPILED) { if (type & HASHX_COMPILED) {
if (!hashx_compiler_init(ctx)) { if (!hashx_compiler_init(ctx)) {
goto failure; goto failure;