projects
/
asterisk/asterisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
78cae35
)
Fix memory leak
author
Tilghman Lesher
<tilghman@meg.abyt.es>
Thu, 1 Nov 2007 05:44:40 +0000
(
05:44
+0000)
committer
Tilghman Lesher
<tilghman@meg.abyt.es>
Thu, 1 Nov 2007 05:44:40 +0000
(
05:44
+0000)
Reported by: eliel
Fixed by: tilghman
Closes issue #11136
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88007
65c4cc65
-6c06-0410-ace0-
fbb531ad65f3
cdr/cdr_adaptive_odbc.c
patch
|
blob
|
history
diff --git
a/cdr/cdr_adaptive_odbc.c
b/cdr/cdr_adaptive_odbc.c
index
66f704d
..
129ae16
100644
(file)
--- a/
cdr/cdr_adaptive_odbc.c
+++ b/
cdr/cdr_adaptive_odbc.c
@@
-314,8
+314,18
@@
static int odbc_log(struct ast_cdr *cdr)
SQLHSTMT stmt = NULL;
SQLLEN rows = 0;
+ if (!sql || !sql2) {
+ if (sql)
+ ast_free(sql);
+ if (sql2)
+ ast_free(sql2);
+ return -1;
+ }
+
if (AST_RWLIST_RDLOCK(&odbc_tables)) {
ast_log(LOG_ERROR, "Unable to lock table list. Insert CDR(s) failed.\n");
+ ast_free(sql);
+ ast_free(sql2);
return -1;
}