projects
/
users
/
rhaas
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8372e3c
)
Fix small memory leak in ecpglib ecpg_update_declare_statement() is called the
author
Michael Meskes
<
[email protected]
>
Tue, 2 Jul 2019 01:51:13 +0000
(
03:51
+0200)
committer
Michael Meskes
<
[email protected]
>
Wed, 3 Jul 2019 01:17:06 +0000
(
03:17
+0200)
second time.
Author: "Zhang, Jie" <
[email protected]
>
src/interfaces/ecpg/ecpglib/prepare.c
patch
|
blob
|
blame
|
history
diff --git
a/src/interfaces/ecpg/ecpglib/prepare.c
b/src/interfaces/ecpg/ecpglib/prepare.c
index 0dcf736390bd7d4e60ca2eab8ad7af49f5573af8..6edff5c0c0dcb65ca45dfee5e7e4acceb8acc8f4 100644
(file)
--- a/
src/interfaces/ecpg/ecpglib/prepare.c
+++ b/
src/interfaces/ecpg/ecpglib/prepare.c
@@
-754,7
+754,11
@@
ecpg_update_declare_statement(const char *declared_name, const char *cursor_name
/* Find the declared node by declared name */
p = ecpg_find_declared_statement(declared_name);
if (p)
+ {
+ if (p->cursor_name)
+ ecpg_free(p->cursor_name);
p->cursor_name = ecpg_strdup(cursor_name, lineno);
+ }
}
/*