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

Commit 0ad5e43

Browse files
committed
Fix misplaced strdup(), which could lead to error messages referencing
deallocated memory later on.
1 parent 81d08fc commit 0ad5e43

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/pl/plpgsql/src/gram.y

Lines changed: 5 additions & 3 deletions
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.12 2000/09/05 09:02:18 wieck Exp $
7+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.13 2001/01/06 01:39:01 tgl Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -378,13 +378,15 @@ decl_rowtype : T_ROW
378378

379379
decl_varname : T_WORD
380380
{
381-
$$.name = plpgsql_tolower(strdup(yytext));
382-
$$.lineno = yylineno;
381+
/* name should be malloc'd for use as varname */
382+
$$.name = strdup(plpgsql_tolower(yytext));
383+
$$.lineno = yylineno;
383384
}
384385
;
385386

386387
decl_renname : T_WORD
387388
{
389+
/* the result must be palloc'd, see plpgsql_ns_rename */
388390
$$ = plpgsql_tolower(yytext);
389391
}
390392
;

0 commit comments

Comments
 (0)