aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-15 07:01:37 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-15 07:01:37 +0000
commit32fe9128168f1253ca5aaa67ed5d7a30327ff313 (patch)
treeb072d2dd6ab18bff6e11445c82985dd0232f4a2a /funcs
parent41fe6df427966456e6f403a77751af0a0bc3d213 (diff)
Need to retrieve the rows affected before using the associated variable.
(closes issue #18795) Reported by: irroot Patches: 20110211__issue18795.diff.txt uploaded by tilghman (license 14) Tested by: tilghman git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@307836 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_odbc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/funcs/func_odbc.c b/funcs/func_odbc.c
index 123d55abf..b82482733 100644
--- a/funcs/func_odbc.c
+++ b/funcs/func_odbc.c
@@ -325,6 +325,10 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co
}
}
+ if (stmt) {
+ SQLRowCount(stmt, &rows);
+ }
+
if (stmt && rows == 0 && ast_str_strlen(insertbuf) != 0) {
SQLCloseCursor(stmt);
SQLFreeHandle(SQL_HANDLE_STMT, stmt);
@@ -347,7 +351,6 @@ static int acf_odbc_write(struct ast_channel *chan, const char *cmd, char *s, co
}
} else if (stmt) {
status = "SUCCESS";
- SQLRowCount(stmt, &rows);
}
AST_RWLIST_UNLOCK(&queries);