Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 09523c9

Browse files
committed
Make code malloc memory of proper length.
1 parent 7771436 commit 09523c9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/pl/plpgsql/src/gram.y

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.22 2001/07/11 18:54:18 momjian Exp $
7+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.23 2001/07/12 01:19:40 momjian Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -332,7 +332,7 @@ decl_statement : decl_varname decl_const decl_datatype decl_notnull decl_defval
332332
{
333333
PLpgSQL_rec *new;
334334

335-
new = malloc(sizeof(PLpgSQL_var));
335+
new = malloc(sizeof(PLpgSQL_rec));
336336

337337
new->dtype = PLPGSQL_DTYPE_REC;
338338
new->refname = $1.name;
@@ -374,8 +374,8 @@ decl_statement : decl_varname decl_const decl_datatype decl_notnull decl_defval
374374
new = malloc(sizeof(PLpgSQL_var));
375375
memset(new, 0, sizeof(PLpgSQL_var));
376376

377-
curname_def = malloc(sizeof(PLpgSQL_var));
378-
memset(curname_def, 0, sizeof(PLpgSQL_var));
377+
curname_def = malloc(sizeof(PLpgSQL_expr));
378+
memset(curname_def, 0, sizeof(PLpgSQL_expr));
379379

380380
new->dtype = PLPGSQL_DTYPE_VAR;
381381
new->refname = $1.name;

0 commit comments

Comments
 (0)