Fix a leak of an error

Review Request #2381 — Created March 23, 2023 and submitted — Latest diff uploaded

Information

hasl/hasl
default

Reviewers

This fixes a leak running tests:

33 (16 direct, 17 indirect) bytes in 1 blocks are definitely lost in loss record 129 of 293
   at 0x484386F: malloc (vg_replace_malloc.c:393)
   by 0x48E7168: g_malloc (gmem.c:130)
   by 0x48FEAB5: g_slice_alloc (gslice.c:1074)
   by 0x48FF0EC: g_slice_alloc0 (gslice.c:1100)
   by 0x48CAECB: g_error_allocate (gerror.c:710)
   by 0x48CB93F: UnknownInlinedFun (gerror.c:724)
   by 0x48CB93F: g_error_new_valist (gerror.c:766)
   by 0x48CBB5E: g_set_error (gerror.c:963)
   by 0x4859392: hasl_mechanism_plain_possible (haslmechanismplain.c:40)
   by 0x4858E4A: hasl_mechanism_possible (haslmechanism.c:48)
   by 0x48589C5: hasl_context_next (haslcontext.c:500)
   by 0x4015D0: test_hasl_full_plain_external_plain_not_possible (test-full.c:69)
   by 0x490CC7D: UnknownInlinedFun (gtestutils.c:2933)
   by 0x490CC7D: g_test_run_suite_internal (gtestutils.c:3021)
   by 0x490C9E4: g_test_run_suite_internal (gtestutils.c:3038)
   by 0x490C9E4: g_test_run_suite_internal (gtestutils.c:3038)
   by 0x490C9E4: g_test_run_suite_internal (gtestutils.c:3038)
   by 0x490D181: g_test_run_suite (gtestutils.c:3115)
   by 0x49056EC: UnknownInlinedFun (gtestutils.c:2234)
   by 0x49056EC: g_test_run (gtestutils.c:2221)
   by 0x401E8D: main (test-full.c:143)

Ran tests with valgrind and no longer saw the leak.

Commits

Files