You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2016/09/16 14:36:37 UTC
qpid-dispatch git commit: DISPATCH-498 - Used
qd_config_ssl_profile_free instead of free() [PR from Ganesh Murthy] This
closes #98
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 58d8aab97 -> 1ee98d495
DISPATCH-498 - Used qd_config_ssl_profile_free instead of free() [PR from Ganesh Murthy]
This closes #98
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/1ee98d49
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/1ee98d49
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/1ee98d49
Branch: refs/heads/master
Commit: 1ee98d4950b18f10ebed623c1a4f711b0ca6f8a0
Parents: 58d8aab
Author: Ted Ross <tr...@redhat.com>
Authored: Fri Sep 16 10:31:00 2016 -0400
Committer: Ted Ross <tr...@redhat.com>
Committed: Fri Sep 16 10:32:56 2016 -0400
----------------------------------------------------------------------
src/connection_manager.c | 25 ++++++++++---------------
1 file changed, 10 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/1ee98d49/src/connection_manager.c
----------------------------------------------------------------------
diff --git a/src/connection_manager.c b/src/connection_manager.c
index 290398b..bdea6aa 100644
--- a/src/connection_manager.c
+++ b/src/connection_manager.c
@@ -83,8 +83,8 @@ struct qd_connection_manager_t {
static qd_config_ssl_profile_t *qd_find_ssl_profile(qd_connection_manager_t *cm, char *name)
{
qd_config_ssl_profile_t *ssl_profile = DEQ_HEAD(cm->config_ssl_profiles);
- while(ssl_profile) {
- if(strcmp(ssl_profile->name, name)==0)
+ while (ssl_profile) {
+ if (strcmp(ssl_profile->name, name) == 0)
return ssl_profile;
ssl_profile = DEQ_NEXT(ssl_profile);
}
@@ -215,7 +215,7 @@ static qd_error_t load_server_config(qd_dispatch_t *qd, qd_server_config_t *conf
strstr(config->sasl_mechanisms, "EXTERNAL") != 0;
*ssl_profile = qd_find_ssl_profile(qd->connection_manager, config->ssl_profile);
- if(*ssl_profile) {
+ if (*ssl_profile) {
config->ssl_certificate_file = (*ssl_profile)->ssl_certificate_file;
config->ssl_private_key_file = (*ssl_profile)->ssl_private_key_file;
config->ssl_password = (*ssl_profile)->ssl_password;
@@ -262,7 +262,7 @@ qd_config_ssl_profile_t *qd_dispatch_configure_ssl_profile(qd_dispatch_t *qd, qd
error:
qd_log(cm->log_source, QD_LOG_ERROR, "Unable to create ssl profile: %s", qd_error_message());
- free(ssl_profile);
+ qd_config_ssl_profile_free(cm, ssl_profile);
return 0;
}
@@ -359,24 +359,21 @@ void qd_connection_manager_free(qd_connection_manager_t *cm)
qd_config_listener_t *cl = DEQ_HEAD(cm->config_listeners);
while (cl) {
DEQ_REMOVE_HEAD(cm->config_listeners);
- qd_server_listener_free(cl->listener);
qd_server_config_free(&cl->configuration);
- free(cl);
+ qd_config_listener_free(cm, cl);
cl = DEQ_HEAD(cm->config_listeners);
}
qd_config_connector_t *cc = DEQ_HEAD(cm->config_connectors);
while (cc) {
DEQ_REMOVE_HEAD(cm->config_connectors);
- qd_server_connector_free(cc->connector);
qd_server_config_free(&cc->configuration);
- free(cc);
+ qd_config_connector_free(cm, cc);
cc = DEQ_HEAD(cm->config_connectors);
}
qd_config_ssl_profile_t *sslp = DEQ_HEAD(cm->config_ssl_profiles);
while (sslp) {
- DEQ_REMOVE_HEAD(cm->config_ssl_profiles);
qd_config_ssl_profile_free(cm, sslp);
sslp = DEQ_HEAD(cm->config_ssl_profiles);
}
@@ -481,16 +478,14 @@ void qd_connection_manager_delete_listener(qd_dispatch_t *qd, void *impl)
/**
- * Only those SSL Profiles that are not being referenced from other listeners/connectors can be deleted
+ * Only those SSL Profiles that are not being referenced from other
+ * listeners/connectors can be deleted
*/
bool qd_connection_manager_delete_ssl_profile(qd_dispatch_t *qd, void *impl)
{
qd_config_ssl_profile_t *ssl_profile = (qd_config_ssl_profile_t*) impl;
- if(ssl_profile) {
- bool freed = qd_config_ssl_profile_free(qd->connection_manager, ssl_profile);
-
- return freed;
- }
+ if (ssl_profile)
+ return qd_config_ssl_profile_free(qd->connection_manager, ssl_profile);
return false;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org