com php-src: add NULL check: ext/pdo_dblib/dblib_stmt.c
| From: | Anatol Belski | Date: | Mon, 29 Feb 2016 14:26:57 +0000 |
| Subject: | com php-src: add NULL check: ext/pdo_dblib/dblib_stmt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91188@lists.php.net to get a copy of this message | ||
Commit: a310c3b484051424c4545a00b731b78a4fff7982
Author: Anatol Belski <ab@php.net> Mon, 29 Feb 2016 15:26:57 +0100
Parents: efaafd45b4e0d4939f3fd5a31d7712ba4cc48162
Branches: PHP-5.6 PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a310c3b484051424c4545a00b731b78a4fff7982
Log:
add NULL check
Changed paths:
M ext/pdo_dblib/dblib_stmt.c
Diff:
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c
index 2e3e881..3876482 100644
--- a/ext/pdo_dblib/dblib_stmt.c
+++ b/ext/pdo_dblib/dblib_stmt.c
@@ -103,8 +103,10 @@ static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
/* Cancel any pending results */
dbcancel(H->link);
- efree(stmt->columns);
- stmt->columns = NULL;
+ if (stmt->columns) {
+ efree(stmt->columns);
+ stmt->columns = NULL;
+ }
return 1;
}