]> granicus.if.org Git - php/commitdiff
fix possible crash in textContent
authorRob Richards <rrichards@php.net>
Wed, 25 Jan 2006 17:33:24 +0000 (17:33 +0000)
committerRob Richards <rrichards@php.net>
Wed, 25 Jan 2006 17:33:24 +0000 (17:33 +0000)
ext/dom/node.c

index ebe88e2d0a7d46d650bafd03bfaeb17216bfa4aa..6630dc13adfc5a6900c5a1d4015eb8dd889487c2 100644 (file)
@@ -840,10 +840,10 @@ int dom_node_text_content_read(dom_object *obj, zval **retval TSRMLS_DC)
 
        if(str != NULL) {
                ZVAL_STRING(*retval, str, 1);
+               xmlFree(str);
        } else {
                ZVAL_EMPTY_STRING(*retval);
        }
-       xmlFree(str);
 
        return SUCCESS;
 }