Skip to content

Commit

Permalink
Lib: fix leak in amqp_ssl_socket_verify_hostname
Browse files Browse the repository at this point in the history
The cert object should be X509_free'd after use, it leaks otherwise.

Thanks Volker Schreiner for reporting this.

Fixes #323
  • Loading branch information
alanxz committed Oct 27, 2015
1 parent d3ee55f commit d6000f4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions librabbitmq/amqp_openssl.c
Expand Up @@ -248,8 +248,12 @@ amqp_ssl_socket_verify_hostname(void *base, const char *host)
goto error;
}
exit:
X509_free(cert);
return status;
error:
if (cert) {
X509_free(cert);
}
status = -1;
goto exit;
}
Expand Down

0 comments on commit d6000f4

Please sign in to comment.