]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
manager: Fix HTTP connection reference leaks.
authorCorey Farrell <git@cfware.com>
Sun, 9 Nov 2014 07:56:41 +0000 (07:56 +0000)
committerCorey Farrell <git@cfware.com>
Sun, 9 Nov 2014 07:56:41 +0000 (07:56 +0000)
Fix reference leak that happens if (session && !blastaway).

ASTERISK-24505 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4153/

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

main/manager.c

index f963c7cd9c13b5fc5ffe68f7f579e56edc828c3c..4305f1cf4c3897531d66d14dba8dd9cf27962e46 100644 (file)
@@ -6674,11 +6674,16 @@ generic_callback_out:
        ast_free(http_header);
        ast_free(out);
 
-       if (session && blastaway) {
-               session_destroy(session);
-       } else if (session && session->f) {
-               fclose(session->f);
-               session->f = NULL;
+       if (session) {
+               if (blastaway) {
+                       session_destroy(session);
+               } else {
+                       if (session->f) {
+                               fclose(session->f);
+                               session->f = NULL;
+                       }
+                       unref_mansession(session);
+               }
        }
 
        return 0;