From: David Vossel Date: Tue, 10 Nov 2009 15:28:57 +0000 (+0000) Subject: Merged revisions 229093 via svnmerge from X-Git-Tag: 1.6.1.10-rc3~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=369b4646b4d6ed5b4fa366f2d3298363ff385caa;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@229095 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index 4fa8f27ee8..d51338708d 100644 --- a/res/res_config_pgsql.c +++ b/res/res_config_pgsql.c @@ -667,7 +667,6 @@ static int update_pgsql(const char *database, const char *tablename, const char ast_debug(1, "PostgreSQL RealTime: Query: %s\n", sql->str); 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); @@ -680,14 +679,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);