]> granicus.if.org Git - php/commitdiff
MFH:
authorAndrey Hristov <andrey@php.net>
Thu, 11 Jun 2009 08:35:47 +0000 (08:35 +0000)
committerAndrey Hristov <andrey@php.net>
Thu, 11 Jun 2009 08:35:47 +0000 (08:35 +0000)
  Check the pointer before calling a function on it, or we will crash.
  This is a very rare situation where the server is totally broken.

ext/mysqlnd/mysqlnd_wireprotocol.c

index c9cc38241e33774e4afd715ad8a3b6c19f627016..abf04ad68007dec9b6d25f8458288d9f678a9298 100644 (file)
@@ -1343,7 +1343,7 @@ php_mysqlnd_read_row_ex(MYSQLND *conn, MYSQLND_MEMORY_POOL_CHUNK **buffer,
                        break;
                }
        }
-       if (ret == FAIL) {
+       if (ret == FAIL && (*buffer)) {
                (*buffer)->free_chunk((*buffer), TRUE TSRMLS_CC);
                *buffer = NULL;
        }