Skip to content

Commit

Permalink
Fix memory leak of ssl_ext_host_name
Browse files Browse the repository at this point in the history
ssl_ext_set_host_name uses strdup() to set a hostname into the ssl_ext
structure, but this memory was not being freed in ssl_ext_free.

Add a one-liner to free it during the ssl_ext_free routine, fixing the leak.
  • Loading branch information
earlephilhower authored and igrr committed Jul 23, 2017
1 parent 27f4a6c commit 5de79d7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ssl/tls1.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ EXP_FUNC void STDCALL ssl_ext_free(SSL_EXTENSIONS *ssl_ext)
return;
}

free(ssl_ext->host_name); // strdup()'d in ssl_ext_set_host_name()

free(ssl_ext);
}

Expand Down

0 comments on commit 5de79d7

Please sign in to comment.