aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_config_sqlite.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-02 23:56:13 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-02 23:56:13 +0000
commitee246d0e0519c6aa7cb0aea17ea92c9a5c2dc16f (patch)
tree80dccc06626175232f48f4c2cde5b9f5ba602632 /res/res_config_sqlite.c
parent11aedae560fa003f20ee8d7a02b7aa2fc17ae13a (diff)
import gcc 4.3.2 warning fixes from trunk, with a few changes specific to this branch
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@153710 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_config_sqlite.c')
-rw-r--r--res/res_config_sqlite.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c
index 2bb4c20ad..c39629925 100644
--- a/res/res_config_sqlite.c
+++ b/res/res_config_sqlite.c
@@ -660,7 +660,10 @@ static struct sqlite_cache_tables *find_table(const char *tablename)
}
/* Table structure not cached; build the structure now */
- asprintf(&sql, sql_table_structure, tablename);
+ if (asprintf(&sql, sql_table_structure, tablename) < 0) {
+ ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno));
+ sql = NULL;
+ }
if (!(tblptr = ast_calloc(1, sizeof(*tblptr) + strlen(tablename) + 1))) {
AST_RWLIST_UNLOCK(&sqlite_tables);
ast_log(LOG_ERROR, "Memory error. Cannot cache table '%s'\n", tablename);