You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2018/03/22 06:20:30 UTC

[26/28] qpid-proton git commit: PROTON-1804: Fix memory leak found by fuzz tester

PROTON-1804: Fix memory leak found by fuzz tester


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

Branch: refs/heads/master
Commit: 99b1d7f5dc5107e690a83a91252c59cff6426619
Parents: ae7c3a8
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed Mar 21 20:22:04 2018 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Wed Mar 21 23:56:40 2018 -0400

----------------------------------------------------------------------
 proton-c/src/core/transport.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/99b1d7f5/proton-c/src/core/transport.c
----------------------------------------------------------------------
diff --git a/proton-c/src/core/transport.c b/proton-c/src/core/transport.c
index 2090a91..0d18f72 100644
--- a/proton-c/src/core/transport.c
+++ b/proton-c/src/core/transport.c
@@ -1196,16 +1196,10 @@ int pn_do_open(pn_transport_t *transport, uint8_t frame_type, uint16_t channel,
       transport->remote_max_frame = AMQP_MIN_MAX_FRAME_SIZE;
     }
   }
-  if (container_q) {
-    transport->remote_container = pn_bytes_strdup(remote_container);
-  } else {
-    transport->remote_container = NULL;
-  }
-  if (hostname_q) {
-    transport->remote_hostname = pn_bytes_strdup(remote_hostname);
-  } else {
-    transport->remote_hostname = NULL;
-  }
+  free(transport->remote_container);
+  transport->remote_container = container_q ? pn_bytes_strdup(remote_container) : NULL;
+  free(transport->remote_hostname);
+  transport->remote_hostname = hostname_q ? pn_bytes_strdup(remote_hostname) : NULL;
 
   if (conn) {
     PN_SET_REMOTE(conn->endpoint.state, PN_REMOTE_ACTIVE);


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