{
zval *wrapper;
- if (! found) {
*found = 0;
- }
if (!obj) {
MAKE_STD_ZVAL(wrapper);
zval *wrapper;
int rsrc_type;
- if (! found) {
*found = 0;
- }
if (!obj) {
MAKE_STD_ZVAL(wrapper);
char *content;
int rsrc_type;
- if (! found) {
*found = 0;
- }
if (!obj) {
MAKE_STD_ZVAL(wrapper);
if (content) {
add_property_long(wrapper, "type", Z_TYPE_P(nodep));
add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1);
+ xmlFree(content);
}
break;
}
if (content) {
add_property_long(wrapper, "type", Z_TYPE_P(nodep));
add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1);
+ xmlFree(content);
}
break;
}
rsrc_type = le_domxmlpip;
content = xmlNodeGetContent(nodep);
add_property_stringl(wrapper, "target", (char *) nodep->name, strlen(nodep->name), 1);
- if (content)
+ if (content) {
add_property_stringl(wrapper, "data", (char *) content, strlen(content), 1);
+ xmlFree(content);
+ }
break;
}
add_property_stringl(wrapper, "name", (char *) nodep->name, strlen(nodep->name), 1);
if (Z_TYPE_P(obj) == XML_ENTITY_REF_NODE) {
content = xmlNodeGetContent(nodep);
- if (content)
+ if (content) {
add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1);
+ xmlFree(content);
+ }
}
break;
}
add_property_stringl(wrapper, "name", (char *) attrp->name, strlen(attrp->name), 1);
add_property_long(wrapper, "type", Z_TYPE_P(attrp));
content = xmlNodeGetContent((xmlNodePtr) attrp);
- if (content)
+ if (content) {
add_property_stringl(wrapper, "value", (char *) content, strlen(content), 1);
+ xmlFree(content);
+ }
break;
}
rsrc_type = le_domxmlcdatap;
content = xmlNodeGetContent(nodep);
add_property_long(wrapper, "type", Z_TYPE_P(nodep));
- if (content)
+ if (content) {
add_property_stringl(wrapper, "content", (char *) content, strlen(content), 1);
+ xmlFree(content);
+ }
break;
}
}
/* }}} */
-/* {{{ proto object domxml_node_prefix(void)
+/* {{{ proto string domxml_node_prefix(void)
Returns namespace prefix of node */
PHP_FUNCTION(domxml_node_prefix)
{
RETURN_FALSE;
}
- RETURN_STRING(mem,1);
+ RETVAL_STRING(mem,1);
+ xmlFree(mem);
}
/* }}} */
value = xmlGetProp(nodep, name);
if (!value) {
- RETURN_EMPTY_STRING();
+ RETURN_FALSE;
} else {
- RETURN_STRING(value, 1);
+ RETVAL_STRING(value, 1);
+ xmlFree(value);
}
}
/* }}} */
DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len);
attrp = xmlHasProp(nodep,name);
- if (attrp == NULL)
- {
+ if (attrp == NULL) {
RETURN_FALSE;
}
xmlUnlinkNode((xmlNodePtr)attrp);
DOMXML_PARAM_TWO(nodep, id, le_domxmlelementp, "s", &name, &name_len);
attrp = xmlHasProp(nodep,name);
- if (attrp == NULL)
- {
+ if (attrp == NULL) {
RETURN_FALSE;
}
DOMXML_RET_OBJ(rv, (xmlNodePtr) attrp, &ret);
htmlDocDumpMemory(docp, &mem, &size);
if (!size) {
+ if (mem)
+ xmlFree(mem);
RETURN_FALSE;
}
RETURN_STRINGL(mem, size, 1);
+ xmlFree(mem);
}
/* }}} */
zval *wrapper;
int rsrc_type;
- if (! found) {
*found = 0;
- }
if (!obj) {
MAKE_STD_ZVAL(wrapper);