]> granicus.if.org Git - php/commitdiff
MFB: Fixed a possible crash
authorIlia Alshanetsky <iliaa@php.net>
Thu, 23 Nov 2006 14:41:51 +0000 (14:41 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 23 Nov 2006 14:41:51 +0000 (14:41 +0000)
ext/pdo/pdo_sql_parser.c
ext/pdo/pdo_sql_parser.re

index 40413179f25e207101206853f010664af6b2e67f..2133efb295305f7fccf96b42a1a441325746ed69 100644 (file)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.10.6 on Sun Nov 12 12:56:00 2006 */
+/* Generated by re2c 0.10.6 on Thu Nov 23 09:42:00 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;
index 55a84b8fad59c03ee7d96b7769bb52773ef550d2..2ef69f67485477924abe2a217e42d5ff1b3b685e 100644 (file)
@@ -192,11 +192,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;