Skip to content

Commit e72489e

Browse files
author
Michael Meskes
committed
Fix small memory leak in ecpglib ecpg_update_declare_statement() is called the
second time. Author: "Zhang, Jie" <zhangjie2@cn.fujitsu.com>
1 parent 8372e3c commit e72489e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/interfaces/ecpg/ecpglib/prepare.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,11 @@ ecpg_update_declare_statement(const char *declared_name, const char *cursor_name
754754
/* Find the declared node by declared name */
755755
p = ecpg_find_declared_statement(declared_name);
756756
if (p)
757+
{
758+
if (p->cursor_name)
759+
ecpg_free(p->cursor_name);
757760
p->cursor_name = ecpg_strdup(cursor_name, lineno);
761+
}
758762
}
759763

760764
/*

0 commit comments

Comments
 (0)