Skip to content
Snippets Groups Projects
Commit c96c01cf authored by Tilghman Lesher's avatar Tilghman Lesher
Browse files

Fix memory leak

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
parent 78cae359
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment