Index: B:/users/irena/proj1/trunk_1/core/al/al_mcast.c
===================================================================
--- B:/users/irena/proj1/trunk_1/core/al/al_mcast.c	(revision 8364)
+++ B:/users/irena/proj1/trunk_1/core/al/al_mcast.c	(revision 8365)
@@ -186,6 +186,12 @@
 		}
 	}
 
+	if (p_h_mcast) 
+	{
+		ref_al_obj(&h_mcast->obj);
+		*p_h_mcast = h_mcast;
+	}
+
 	/* Issue the MAD to the SA. */
 	status = send_join( h_mcast, p_mcast_req );
 	if( status == IB_SUCCESS )
@@ -200,15 +206,15 @@
 			} while( cl_status == CL_NOT_DONE );
 			CL_ASSERT( cl_status == CL_SUCCESS );
 		}
-
+	}
+	else
+	{
 		if (p_h_mcast) 
 		{
-			ref_al_obj(&h_mcast->obj);
-			*p_h_mcast = h_mcast;
+			deref_al_obj(&h_mcast->obj);
+			*p_h_mcast = NULL;
 		}
-	}
-	else
-	{
+		
 		// usually it happens, when opensm is not running- that's why warning
 		AL_PRINT_EXIT( TRACE_LEVEL_WARNING, AL_DBG_ERROR,
 			("unable to send join request: %s\n", ib_get_err_str(status)) );
