diff options
author | David Vossel <dvossel@digium.com> | 2009-11-10 15:27:45 +0000 |
---|---|---|
committer | David Vossel <dvossel@digium.com> | 2009-11-10 15:27:45 +0000 |
commit | 4e14faaefe4edc5b1f32c2a42f2ac2acdcdc5541 (patch) | |
tree | 984f74af5a97b0e86ab66ae16992f01741942537 /res | |
parent | 5050e04101b9bfc1659ecdff1a1be86d66fc8ba8 (diff) |
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: https://origsvn.digium.com/svn/asterisk/trunk@229093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_config_pgsql.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index 5622d6762..e4bffd307 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); |