summaryrefslogtreecommitdiff
path: root/res/res_odbc.c
diff options
context:
space:
mode:
authorWalter Doekes <walter+asterisk@wjd.nu>2012-04-17 18:57:40 +0000
committerWalter Doekes <walter+asterisk@wjd.nu>2012-04-17 18:57:40 +0000
commitfc63e07135d645af0df8d393aa84c0ae3b7e1924 (patch)
treef40524fe8e0facf5542c6b02041bc1fc63eae66e /res/res_odbc.c
parent70c5ac6635062efe03b51fb6c7afd30c22028be9 (diff)
Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: junky Review: https://reviewboard.asterisk.org/r/1743/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_odbc.c')
-rw-r--r--res/res_odbc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 1a4b77662..5aaff57f1 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -1492,7 +1492,7 @@ static odbc_status odbc_obj_disconnect(struct odbc_obj *obj)
}
}
- if ((res = SQLFreeHandle(SQL_HANDLE_DBC, con) == SQL_SUCCESS)) {
+ if ((res = SQLFreeHandle(SQL_HANDLE_DBC, con)) == SQL_SUCCESS) {
ast_debug(1, "Database handle %p deallocated\n", con);
} else {
SQLGetDiagRec(SQL_HANDLE_DBC, con, 1, state, &err, msg, 100, &mlen);
@@ -1546,7 +1546,7 @@ static odbc_status odbc_obj_connect(struct odbc_obj *obj)
SQLGetDiagRec(SQL_HANDLE_DBC, con, 1, state, &err, msg, 100, &mlen);
obj->parent->last_negative_connect = ast_tvnow();
ast_log(LOG_WARNING, "res_odbc: Error SQLConnect=%d errno=%d %s\n", res, (int)err, msg);
- if ((res = SQLFreeHandle(SQL_HANDLE_DBC, con) != SQL_SUCCESS)) {
+ if ((res = SQLFreeHandle(SQL_HANDLE_DBC, con)) != SQL_SUCCESS) {
SQLGetDiagRec(SQL_HANDLE_DBC, con, 1, state, &err, msg, 100, &mlen);
ast_log(LOG_WARNING, "Unable to deallocate database handle %p? %d errno=%d %s\n", con, res, (int)err, msg);
}