aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-10 15:28:22 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-11-10 15:28:22 +0000
commit093745b7574f3403b78d90010ab2d4b7e0b610d2 (patch)
treea86a9e32ca0375b3be215a3aafa4bbf05f46f3e3
parent928efd5caa2647e9e281e9ec3573fddf22cdb7fe (diff)
Merged revisions 229093 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ........ r229093 | dvossel | 2009-11-10 09:27:45 -0600 (Tue, 10 Nov 2009) | 11 lines fixes pgsql double free of threadstorage A thread storage variable was being freed incorrectly, which resulted in a double free if two queries were made in the same thread. (closes issue #16011) Reported by: cristiandimache Patches: issue16011.diff uploaded by dvossel (license 671) ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@229094 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_config_pgsql.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c
index f385535e2..7d53d6a59 100644
--- a/res/res_config_pgsql.c
+++ b/res/res_config_pgsql.c
@@ -678,7 +678,6 @@ static int update_pgsql(const char *database, const char *tablename, const char
ast_debug(1, "PostgreSQL RealTime: Query: %s\n", ast_str_buffer(sql));
ast_debug(1, "PostgreSQL RealTime: Query Failed because: %s\n", PQerrorMessage(pgsqlConn));
ast_mutex_unlock(&pgsql_lock);
- ast_free(sql);
return -1;
} else {
ExecStatusType result_status = PQresultStatus(result);
@@ -691,14 +690,12 @@ static int update_pgsql(const char *database, const char *tablename, const char
ast_debug(1, "PostgreSQL RealTime: Query Failed because: %s (%s)\n",
PQresultErrorMessage(result), PQresStatus(result_status));
ast_mutex_unlock(&pgsql_lock);
- ast_free(sql);
return -1;
}
}
numrows = atoi(PQcmdTuples(result));
ast_mutex_unlock(&pgsql_lock);
- ast_free(sql);
ast_debug(1, "PostgreSQL RealTime: Updated %d rows on table: %s\n", numrows, tablename);