Merge pull request #22 from malahal/duplex-13

Use partition size for deleting GSS contexts/Fix gss data leak
diff --git a/ntirpc/rpc/xdr_inline.h b/ntirpc/rpc/xdr_inline.h
index 1e85cba..6c8a3ba 100644
--- a/ntirpc/rpc/xdr_inline.h
+++ b/ntirpc/rpc/xdr_inline.h
@@ -571,7 +571,7 @@
 
 	case XDR_FREE:
 		if (sp != NULL) {
-			mem_free(sp, nodesize);
+			mem_free(sp, -1);
 			*cpp = NULL;
 		}
 		return (true);
@@ -661,7 +661,7 @@
 	case XDR_FREE:
 		if (sp == NULL)
 			return (true);	/* already free */
-		/* FALLTHROUGH */
+		break;
 	case XDR_ENCODE:
 		if (sp == NULL)
 			return false;
@@ -672,7 +672,7 @@
 	}
 	if (!inline_xdr_u_int(xdrs, &size))
 		return (false);
-	if (size > maxsize)
+	if (size > maxsize && xdrs->x_op != XDR_FREE)
 		return (false);
 	nodesize = size + 1;
 	if (nodesize == 0) {
@@ -698,7 +698,7 @@
 		return (inline_xdr_putopaque(xdrs, sp, size));
 
 	case XDR_FREE:
-		mem_free(sp, nodesize);
+		mem_free(sp, -1);
 		*cpp = NULL;
 		return (true);
 	}