diff options
author | Michael Meskes <meskes@postgresql.org> | 2015-02-05 15:12:34 +0100 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2015-08-12 13:57:57 +0200 |
commit | a2b2565fc9318b8903ef4821bc0be40a64810aec (patch) | |
tree | c6c4c383f71cccc8f59578223c60c21470c28475 /src/interfaces/ecpg/ecpglib/extern.h | |
parent | 7a801ba8ce7befc2309ece2ca918eb688c67fda9 (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.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interfaces/ecpg/ecpglib/extern.h b/src/interfaces/ecpg/ecpglib/extern.h index 0d55102d0da..f9974b5cd48 100644 --- a/src/interfaces/ecpg/ecpglib/extern.h +++ b/src/interfaces/ecpg/ecpglib/extern.h @@ -123,8 +123,7 @@ struct variable /* 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, @@ -135,6 +134,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); |