Skip to content

Commit

Permalink
fix: cacertifle leak in listener neg cases
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Sep 26, 2023
1 parent b3ae337 commit b16d1c0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions c_src/quicer_listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ listen2(ErlNifEnv *env, __unused_parm__ int argc, const ERL_NIF_TERM argv[])
if (!parse_cacertfile_option(env, options, &cacertfile))
{
// TLS opt error not file content error
free(cacertfile);
return ERROR_TUPLE_2(ATOM_CACERTFILE);
}

Expand Down Expand Up @@ -410,6 +411,7 @@ listen2(ErlNifEnv *env, __unused_parm__ int argc, const ERL_NIF_TERM argv[])
return OK_TUPLE_2(listenHandle);

exit: // errors..
free(cacertfile);
free_certificate(&CredConfig);
destroy_l_ctx(l_ctx);
return ret;
Expand Down

0 comments on commit b16d1c0

Please sign in to comment.