 template<typename VertexId, typename Value, typename SizeT>
 bool IsConnected(const Csr<VertexId, Value, SizeT> & graph)
 {
-  // malloc output graph
-  GunrockGraph *graph_output =
-    (GunrockGraph*)malloc(sizeof(GunrockGraph));
+  GunrockGraph *temp = (GunrockGraph*)malloc(sizeof(GunrockGraph));
   unsigned int *components = (unsigned int*)malloc(sizeof(unsigned int));
-  run_cc<int, int, int>(graph_output, components, graph, 0, 1);
+  run_cc<VertexId, Value, SizeT>(temp, components, graph, 0, 1);
+  if (temp) free(temp);
   return *components == 1;
 }
 

  util::GRError(mst_problem->Extract(h_mst_output),
    "MST Problem Data Extraction Failed", __FILE__, __LINE__);

  if (!g_quick) // run CPU reference test
  {
    // calculate GPU final number of selected edges
    int num_selected_gpu = 0;

      g_undirected,
      false) != 0) { return 1; }

    // display input graph
    // csr.DisplayGraph();

    /**************************************************************************
     * Note: Minimum Spanning Tree only supports undirected, connected graphs *
     **************************************************************************/

    // test graph connectivity
    if (IsConnected(csr))
    {
        RunTests(csr, args, *context);
