[PVFS2-CVS] commit by pcarns in pvfs2/src/server: pvfs2-server.c

CVS commit program cvs at parl.clemson.edu
Wed Sep 1 17:49:33 EDT 2004


Update of /projects/cvsroot/pvfs2/src/server
In directory parlweb:/tmp/cvs-serv23099/src/server

Modified Files:
	pvfs2-server.c 
Log Message:
add a few safety checks to server_state_machine_complete() so that it is
safe to call for server state machines that are not launched by an incoming
request


Index: pvfs2-server.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/server/pvfs2-server.c,v
diff -p -u -r1.170 -r1.171
--- pvfs2-server.c	24 Aug 2004 14:57:30 -0000	1.170
+++ pvfs2-server.c	1 Sep 2004 20:49:31 -0000	1.171
@@ -1428,10 +1428,16 @@ int server_state_machine_complete(PINT_s
                          0, tmp_id, PVFS_EVENT_FLAG_END);
 
     /* release the decoding of the unexpected request */
-    PINT_decode_release(&(s_op->decoded),PINT_DECODE_REQ);
+    if(ENCODING_IS_VALID(s_op->decoded.enc_type))
+    {
+        PINT_decode_release(&(s_op->decoded),PINT_DECODE_REQ);
+    }
 
     /* free the buffer that the unexpected request came in on */
-    free(s_op->unexp_bmi_buff.buffer);
+    if(s_op->unexp_bmi_buff.buffer)
+    {
+        free(s_op->unexp_bmi_buff.buffer);
+    }
 
     /* free the operation structure itself */
     free(s_op);



More information about the PVFS2-CVS mailing list