From: David Vossel Date: Tue, 10 Nov 2009 15:36:10 +0000 (+0000) Subject: reverting changes made by r229095 as they are not applicable to 1.6.1 X-Git-Tag: 1.6.1.10-rc3~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c148e61d86084c4297397f241952f7c723caa172;p=thirdparty%2Fasterisk.git reverting changes made by r229095 as they are not applicable to 1.6.1 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@229098 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index d51338708d..4fa8f27ee8 100644 --- a/res/res_config_pgsql.c +++ b/res/res_config_pgsql.c @@ -667,6 +667,7 @@ 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); @@ -679,12 +680,14 @@ 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);