Content-Length: 261781 | pFad | http://github.com/postgrespro/postgres_cluster/commit/e72489e101b21c328e3d10ca64e5367c60f424a5

15 Fix small memory leak in ecpglib ecpg_update_declare_statement() is c… · postgrespro/postgres_cluster@e72489e · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/e72489e101b21c328e3d10ca64e5367c60f424a5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy