diff options
author | Michael Meskes <meskes@postgresql.org> | 2006-06-26 14:13:04 +0000 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2006-06-26 14:13:04 +0000 |
commit | b48aeb5145ea61dda20e1307e532df3976a463cc (patch) | |
tree | 55651d371762d7c1375a2904cd5c173014f0360f | |
parent | a503fd36344c7c6a00198fdadb80205f1412c54d (diff) | |
download | postgresql-b48aeb5145ea61dda20e1307e532df3976a463cc.tar.gz postgresql-b48aeb5145ea61dda20e1307e532df3976a463cc.zip |
Added missing braces to prevent a segfault after usage of an undeclared cursor.
-rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index 4765ec13c98..4abd062c8e3 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.303.4.5 2005/10/14 01:50:23 momjian Exp $ */ +/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.303.4.6 2006/06/26 14:13:04 meskes Exp $ */ /* Copyright comment */ %{ @@ -292,6 +292,7 @@ add_additional_variables(char *name, bool insert) mmerror(PARSE_ERROR, ET_ERROR, "trying to access an undeclared cursor %s\n", name); return NULL; } + if (insert) { /* add all those input variables that were given earlier @@ -811,8 +812,10 @@ stmt: AlterDatabaseSetStmt { output_statement($1, 0, connection); } struct cursor *ptr; if ((ptr = add_additional_variables($1, true)) != NULL) + { output_statement(mm_strdup(ptr->command), 0, ptr->connection ? mm_strdup(ptr->connection) : NULL); - ptr->opened = true; + ptr->opened = true; + } } | ECPGPrepare { |