]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
manager: Fix HTTP connection reference leaks.
authorCorey Farrell <git@cfware.com>
Sun, 9 Nov 2014 08:00:19 +0000 (08:00 +0000)
committerCorey Farrell <git@cfware.com>
Sun, 9 Nov 2014 08:00:19 +0000 (08:00 +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
........

Merged revisions 427642 from http://svn.asterisk.org/svn/asterisk/branches/12

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

main/manager.c

index 1c5d123954d112e322907997a314982a3eb29be2..0c5d76a195bb8430c09264fa4443884726b6520f 100644 (file)
@@ -7496,11 +7496,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;