summaryrefslogtreecommitdiff
path: root/ext/pdo/pdo_sql_parser.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2006-11-23 14:41:35 +0000
committerIlia Alshanetsky <iliaa@php.net>2006-11-23 14:41:35 +0000
commitaf16066603b04053c240e63b5934dac7a2f68d44 (patch)
treeda4f27e32cb57c88e319ca695b6577957f4dcf34 /ext/pdo/pdo_sql_parser.c
parentc663787ab497226834a8f2253f3d921dda42b91a (diff)
downloadphp-git-af16066603b04053c240e63b5934dac7a2f68d44.tar.gz
Fixed a possible crash
Diffstat (limited to 'ext/pdo/pdo_sql_parser.c')
-rw-r--r--ext/pdo/pdo_sql_parser.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 6037671561..020f98540d 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.10.6 on Sun Nov 12 12:53:54 2006 */
+/* Generated by re2c 0.10.6 on Thu Nov 23 09:39:04 2006 */
#line 1 "ext/pdo/pdo_sql_parser.re"
/*
+----------------------------------------------------------------------+
@@ -412,11 +412,14 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
/* bork */
ret = -1;
strcpy(stmt->error_code, stmt->dbh->error_code);
- efree(buf);
+ if (buf) {
+ efree(buf);
+ }
goto clean_up;
}
- efree(buf);
-
+ if (buf) {
+ efree(buf);
+ }
} else {
pdo_raise_impl_error(stmt->dbh, stmt, "HY105", "Expected a stream resource" TSRMLS_CC);
ret = -1;