]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 372165 via svnmerge from
authorAutomerge script <automerge@asterisk.org>
Wed, 5 Sep 2012 02:22:04 +0000 (02:22 +0000)
committerAutomerge script <automerge@asterisk.org>
Wed, 5 Sep 2012 02:22:04 +0000 (02:22 +0000)
file:///srv/subversion/repos/asterisk/branches/10

................
  r372165 | mjordan | 2012-09-04 21:19:25 -0500 (Tue, 04 Sep 2012) | 18 lines

  Fix memory leak when CEL is successfully written to PostgreSQL database

  PQClear is not called when the result object of a call to PQExec has a
  status of PGRES_COMMAND_OK.  Interestingly enough, the off nominal case was
  handled properly, so this memory leak only occurred when CEL records were
  successfully written.

  This patch properly clears the result in the nominal code path.

  (closes issue ASTERISK-19991)
  Reported by: Etienne Lessard
  Tested by: Etienne Lessard
  patches:
    mem_leak_cel_pgsql.patch uploaded by Etienne Lessard (license #6394)
  ........

  Merged revisions 372158 from http://svn.asterisk.org/svn/asterisk/branches/1.8
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@372174 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cel/cel_pgsql.c

index 99374a824e7c46ec2a3e5237a32940a9ca2c9292..e3c682b60419280f7396ea868a87e335b2256dab 100644 (file)
@@ -321,6 +321,7 @@ static void pgsql_log(const struct ast_event *event, void *userdata)
                        PQclear(result);
                        goto ast_log_cleanup;
                }
+               PQclear(result);
 
 ast_log_cleanup:
                ast_free(sql);