]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
reverting changes made by r229095 as they are not applicable to 1.6.1
authorDavid Vossel <dvossel@digium.com>
Tue, 10 Nov 2009 15:36:10 +0000 (15:36 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 10 Nov 2009 15:36:10 +0000 (15:36 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@229098 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_config_pgsql.c

index d51338708de6d21dbdf0dfa3afee6c43bde0e90f..4fa8f27ee821ea5fbc4aeffab512e7c1613bd87c 100644 (file)
@@ -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);