mirror of
https://github.com/postgres/postgres.git
synced 2025-08-27 07:42:10 +03:00
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>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user