summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meskes2019-07-02 01:51:13 +0000
committerMichael Meskes2019-07-03 01:17:06 +0000
commite72489e101b21c328e3d10ca64e5367c60f424a5 (patch)
tree0420a74b9fef483a40b6db6c136546f1785880f3
parent8372e3c98fbbd529e4545c4d7982e278e118958e (diff)
Fix small memory leak in ecpglib ecpg_update_declare_statement() is called the
second time. Author: "Zhang, Jie" <[email protected]>
-rw-r--r--src/interfaces/ecpg/ecpglib/prepare.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/interfaces/ecpg/ecpglib/prepare.c b/src/interfaces/ecpg/ecpglib/prepare.c
index 0dcf736390b..6edff5c0c0d 100644
--- 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);
+ }
}
/*