--- misc.c.orig 2015-06-11 09:23:13.807020490 -0700 +++ misc.c 2015-06-11 09:32:10.077177669 -0700 @@ -143,6 +143,9 @@ if (sqlca == NULL) { sqlca = malloc(sizeof(struct sqlca_t)); + if (sqlca == NULL) { /* malloc() failed, now what should we do? */ + ecpg_log("Unable to allocate memory in ECPGget_sqlca()\n"); + } ecpg_init_sqlca(sqlca); pthread_setspecific(sqlca_key, sqlca); }