qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcpie...@apache.org
Subject [13/50] qpid-proton git commit: PROTON-916: copy SASL config name to allow bindings to release the name
Date Thu, 18 Jun 2015 14:03:20 GMT
PROTON-916: copy SASL config name to allow bindings to release the name


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/5b611b70
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/5b611b70
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/5b611b70

Branch: refs/heads/PROTON-781-ruby-reactor-apis
Commit: 5b611b704441c508541b444300fbeb398ef61f80
Parents: 718d8b3
Author: Ken Giusti <kgiusti@apache.org>
Authored: Wed Jun 17 15:01:55 2015 -0400
Committer: Ken Giusti <kgiusti@apache.org>
Committed: Wed Jun 17 15:01:55 2015 -0400

----------------------------------------------------------------------
 proton-c/src/sasl/sasl-internal.h | 2 +-
 proton-c/src/sasl/sasl.c          | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5b611b70/proton-c/src/sasl/sasl-internal.h
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl-internal.h b/proton-c/src/sasl/sasl-internal.h
index 40df261..71205f5 100644
--- a/proton-c/src/sasl/sasl-internal.h
+++ b/proton-c/src/sasl/sasl-internal.h
@@ -61,7 +61,7 @@ struct pni_sasl_t {
   char *included_mechanisms;
   const char *username;
   char *password;
-  const char *config_name;
+  char *config_name;
   char *config_dir;
   const char *remote_fqdn;
   char *external_auth;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/5b611b70/proton-c/src/sasl/sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c
index c339ea9..47084ee 100644
--- a/proton-c/src/sasl/sasl.c
+++ b/proton-c/src/sasl/sasl.c
@@ -366,7 +366,7 @@ pn_sasl_t *pn_sasl(pn_transport_t *transport)
     sasl->included_mechanisms = NULL;
     sasl->username = NULL;
     sasl->password = NULL;
-    sasl->config_name = sasl->client ? "proton-client" : "proton-server";
+    sasl->config_name = pn_strdup(sasl->client ? "proton-client" : "proton-server");
     sasl->config_dir =  sasl_config_path ? pn_strdup(sasl_config_path) : NULL;
     sasl->remote_fqdn = NULL;
     sasl->external_auth = NULL;
@@ -455,7 +455,8 @@ void pn_sasl_allowed_mechs(pn_sasl_t *sasl0, const char *mechs)
 void pn_sasl_config_name(pn_sasl_t *sasl0, const char *name)
 {
     pni_sasl_t *sasl = get_sasl_internal(sasl0);
-    sasl->config_name = name;
+    free(sasl->config_name);
+    sasl->config_name = pn_strdup(name);
 }
 
 void pn_sasl_config_path(pn_sasl_t *sasl0, const char *dir)
@@ -487,6 +488,7 @@ void pn_sasl_free(pn_transport_t *transport)
       free(sasl->selected_mechanism);
       free(sasl->included_mechanisms);
       free(sasl->password);
+      free(sasl->config_name);
       free(sasl->config_dir);
       free(sasl->external_auth);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message