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

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

Merged revisions 427641 from http://svn.asterisk.org/svn/asterisk/branches/11

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

main/manager.c

index 0129c1ec7a765e560a33ec304ff2b586766fb8af..1751927ab4e500d4d45f1f3b63e52cdd86580068 100644 (file)
@@ -7314,11 +7314,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;