[gdome] Possible problem XPath



In the XPATH module gdome_xpath_xpeval_createResult, note that it calls
gdome_xpath_xpresult_mkref passing NULLs. This is turn calls
gdome_xml_n_ref (gnode, &exc) that fails if it receives NULL.
Unless I am not seeing something, I think there is a problem here and
would like to report that to the team...
Thanks,Alex

/*
*
* gdome_xpath_xpeval_createResult:
* @self:  GdomeXPathEvaluator Object ref
* @exc:  Exception Object ref
*
* Returns: an GdomeXPathResult object which may be passed as a parameter
to the
*          evaluation methods of this GdomeXPathEvaluator so that a new
one is not
*          created on each call to an evaluation method.
*/

GdomeXPathResult *gdome_xpath_xpeval_createResult (GdomeXPathEvaluator
*self, GdomeException *exc)
{	
  return gdome_xpath_xpresult_mkref(NULL, NULL);
}


GdomeXPathResult *gdome_xpath_xpresult_mkref (GdomeNode *gnode,
xmlXPathObjectPtr res)
{
  Gdome_xpath_XPathResult *result = NULL;
  GdomeException exc;

  result = g_new (Gdome_xpath_XPathResult, 1);
  result->res = res;
  result->refcnt = 1;
  result->gnode = gnode;
  result->pos = 0;
  result->vtab = &gdome_xpath_xpresult_vtab;
  gdome_xml_n_ref (gnode, &exc);
  return (GdomeXPathResult *)result;
}

void gdome_xml_n_ref (GdomeNode *self, GdomeException *exc) 
{
  Gdome_xml_Node *priv = (Gdome_xml_Node *)self;
  g_return_if_fail (priv != NULL);
  g_return_if_fail (GDOME_XML_IS_N (priv));
  g_return_if_fail (exc != NULL);
  priv->refcnt++;
}




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]