summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorMichael Scherer <misc@redhat.com>2017-02-22 17:58:24 +0100
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-26 11:30:55 -0500
commit730f520a1ee246a5f4a08a321b6f97bdf93536dc (patch)
tree8bf9bec0c8c2180c9e6241efb215212fed28f36f /rpc
parent66edcc856d89ffa33318443aa8680c9376772c4d (diff)
Free iobuf after using it, not before
Coverity warn of use after free here. I assume that under pressure, this might crash the whole process. Change-Id: I15fb5cfc9b509705e96e4156b739988d816bbef5 BUG: 789278 Signed-off-by: Michael Scherer <misc@redhat.com> Reviewed-on: https://review.gluster.org/16719 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Michael Scherer <misc@fedoraproject.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 09020aa68ae..c7907832e3c 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -1438,11 +1438,11 @@ sp_state_read_proghdr_xdata:
}
iobref_add (in->iobref, iobuf);
- iobuf_unref (iobuf);
in->payload_vector.iov_base = iobuf_ptr (iobuf);
-
frag->fragcurrent = iobuf_ptr (iobuf);
+
+ iobuf_unref (iobuf);
}
request->vector_state = SP_STATE_READING_PROG;