summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/ecpglib/extern.h
diff options
context:
space:
mode:
authorMichael Meskes <meskes@postgresql.org>2015-02-05 15:12:34 +0100
committerMichael Meskes <meskes@postgresql.org>2015-08-12 13:56:57 +0200
commited089d2fec8dde61d169f1f67a96e099425e77c7 (patch)
treeae3e1560241043b826891c8007c8c8f54d8a9d73 /src/interfaces/ecpg/ecpglib/extern.h
parenta54875602a057f8ee0cf5e880bfe2056b5dd11f0 (diff)
This routine was calling ecpg_alloc to allocate to memory but did not
actually check the returned pointer allocated, potentially NULL which could be the result of a malloc call. Issue noted by Coverity, fixed by Michael Paquier <michael@otacoo.com>
Diffstat (limited to 'src/interfaces/ecpg/ecpglib/extern.h')
-rw-r--r--src/interfaces/ecpg/ecpglib/extern.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h
index 835e70c38f4..7583529874b 100644
--- a/src/interfaces/ecpg/ecpglib/extern.h
+++ b/src/interfaces/ecpg/ecpglib/extern.h
@@ -132,8 +132,7 @@ extern struct var_list *ivlist;
/* Here are some methods used by the lib. */
-/* Returns a pointer to a string containing a simple type name. */
-void ecpg_add_mem(void *ptr, int lineno);
+bool ecpg_add_mem(void *ptr, int lineno);
bool ecpg_get_data(const PGresult *, int, int, int, enum ECPGttype type,
enum ECPGttype, char *, char *, long, long, long,
@@ -144,6 +143,7 @@ void ecpg_pthreads_init(void);
#endif
struct connection *ecpg_get_connection(const char *);
char *ecpg_alloc(long, int);
+char *ecpg_auto_alloc(long, int);
char *ecpg_realloc(void *, long, int);
void ecpg_free(void *);
bool ecpg_init(const struct connection *, const char *, const int);