com php-src: Allow just set or get context passing NULL pointers: ext/libxml/libxml.c

From: Date: Thu, 15 May 2014 07:14:12 +0000
Subject: com php-src: Allow just set or get context passing NULL pointers: ext/libxml/libxml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78355@lists.php.net to get a copy of this message
Commit: 04456f8fab5749096b59bc017842887efc496829 Author: Dmitry Stogov <dmitry@zend.com> Thu, 15 May 2014 11:14:12 +0400 Parents: 281663f75d24d491932109fa5878f9a23031dda8 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=04456f8fab5749096b59bc017842887efc496829 Log: Allow just set or get context passing NULL pointers Changed paths: M ext/libxml/libxml.c Diff: diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 47bc5ca..8fd661c 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -765,8 +765,12 @@ PHP_LIBXML_API void php_libxml_shutdown(void) PHP_LIBXML_API void php_libxml_switch_context(zval *context, zval *oldcontext TSRMLS_DC) { - ZVAL_COPY_VALUE(oldcontext, &LIBXML(stream_context)); - ZVAL_COPY_VALUE(&LIBXML(stream_context), context); + if (oldcontext) { + ZVAL_COPY_VALUE(oldcontext, &LIBXML(stream_context)); + } + if (context) { + ZVAL_COPY_VALUE(&LIBXML(stream_context), context); + } } static PHP_MINIT_FUNCTION(libxml)

« previous php.cvs (#78355) next »