aboutsummaryrefslogtreecommitdiffstats
path: root/res/res_config_sqlite.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-17 18:37:22 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-07-17 18:37:22 +0000
commit696f62f83e4760d5c26bd0b5a3374aa74cb5c8c3 (patch)
tree891dce0070548983dc761dbcab4123161966a4e4 /res/res_config_sqlite.c
parentc81d9ab93b4c34f9fcaff778cfd4cdec179cd99e (diff)
Merged revisions 131753 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r131753 | tilghman | 2008-07-17 13:36:34 -0500 (Thu, 17 Jul 2008) | 6 lines Fix memory leaks (closes issue #13099) Reported by: gknispel_proformatique Patches: res_config_sqlite_leak_on_error.patch uploaded by gknispel (license 261) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@131754 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_config_sqlite.c')
-rw-r--r--res/res_config_sqlite.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c
index 1dcf254e3..77d2f5875 100644
--- a/res/res_config_sqlite.c
+++ b/res/res_config_sqlite.c
@@ -1175,6 +1175,7 @@ static int realtime_update_handler(const char *database, const char *table,
if (!(tmp_str = sqlite_mprintf("%s WHERE %q = '%q';", query, keyfield, entity))) {
ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+ sqlite_freemem(query);
return -1;
}
@@ -1235,6 +1236,7 @@ static int realtime_store_handler(const char *database, const char *table, va_li
}
if (!tmp_keys) {
ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+ sqlite_freemem(tmp_vals);
ast_free(params);
ast_free(vals);
return -1;
@@ -1248,6 +1250,7 @@ static int realtime_store_handler(const char *database, const char *table, va_li
}
if (!tmp_vals) {
ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+ sqlite_freemem(tmp_keys);
ast_free(params);
ast_free(vals);
return -1;
@@ -1263,6 +1266,8 @@ static int realtime_store_handler(const char *database, const char *table, va_li
if (!(tmp_str = sqlite_mprintf(QUERY, table, tmp_keys, tmp_vals))) {
ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+ sqlite_freemem(tmp_keys);
+ sqlite_freemem(tmp_vals);
return -1;
}
@@ -1342,6 +1347,7 @@ static int realtime_destroy_handler(const char *database, const char *table,
ast_free(vals);
if (!(tmp_str = sqlite_mprintf("%s %q = '%q';", query, keyfield, entity))) {
ast_log(LOG_WARNING, "Unable to reallocate SQL query\n");
+ sqlite_freemem(query);
return -1;
}
sqlite_freemem(query);