forked from pool/libtirpc
40 lines
1.2 KiB
Diff
40 lines
1.2 KiB
Diff
commit 419d35db75ab8bd8f79c424f529a6c2f7c4f5fa7
|
|
Author: Steve Dickson <steved@redhat.com>
|
|
Date: Fri May 4 09:27:00 2007 -0400
|
|
|
|
Fixed mutex locking problem in clnt_raw.c. One should grab the
|
|
clntraw_lock before accessing at clntraw_private, not after.
|
|
|
|
Signed-off-by: Steve Dickson <steved@redhat.com>
|
|
|
|
Index: libtirpc-0.1.7/src/clnt_raw.c
|
|
===================================================================
|
|
--- libtirpc-0.1.7.orig/src/clnt_raw.c
|
|
+++ libtirpc-0.1.7/src/clnt_raw.c
|
|
@@ -82,12 +82,13 @@ clnt_raw_create(prog, vers)
|
|
rpcprog_t prog;
|
|
rpcvers_t vers;
|
|
{
|
|
- struct clntraw_private *clp = clntraw_private;
|
|
+ struct clntraw_private *clp;
|
|
struct rpc_msg call_msg;
|
|
- XDR *xdrs = &clp->xdr_stream;
|
|
- CLIENT *client = &clp->client_object;
|
|
+ XDR *xdrs;
|
|
+ CLIENT *client;
|
|
|
|
mutex_lock(&clntraw_lock);
|
|
+ clp = clntraw_private;
|
|
if (clp == NULL) {
|
|
clp = (struct clntraw_private *)calloc(1, sizeof (*clp));
|
|
if (clp == NULL) {
|
|
@@ -100,6 +101,8 @@ clnt_raw_create(prog, vers)
|
|
clp->_raw_buf = __rpc_rawcombuf;
|
|
clntraw_private = clp;
|
|
}
|
|
+ xdrs = &clp->xdr_stream;
|
|
+ client = &clp->client_object;
|
|
/*
|
|
* pre-serialize the static part of the call msg and stash it away
|
|
*/
|