diff options
author | Raghavendra G <raghavendra@gluster.com> | 2010-08-26 00:30:03 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-26 00:09:25 -0700 |
commit | e541154b79f8632fa82fa5b4f8f27aa2cb4ea55a (patch) | |
tree | b4b36a6e4b38c3ef188042d083ebf423eefd4f49 /rpc | |
parent | fb7cfce92572cd827de99fc076b5bb883972a057 (diff) |
transport/socket: free priv->incoming.request_info if not already freed after reading each message.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 1438 (memory leaks)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1438
Diffstat (limited to 'rpc')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index da9a6d64b6c..6d2d584d111 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -396,6 +396,10 @@ __socket_reset (rpc_transport_t *this) iobuf_unref (priv->incoming.iobuf); } + if (priv->incoming.request_info != NULL) { + GF_FREE (priv->incoming.request_info); + } + memset (&priv->incoming, 0, sizeof (priv->incoming)); event_unregister (this->ctx->event_pool, priv->sock, priv->idx); @@ -1313,6 +1317,11 @@ void __socket_reset_priv (socket_private_t *priv) iobuf_unref (priv->incoming.iobuf); } + if (priv->incoming.request_info != NULL) { + GF_FREE (priv->incoming.request_info); + priv->incoming.request_info = NULL; + } + memset (&priv->incoming.payload_vector, 0, sizeof (priv->incoming.payload_vector)); |