Merged revisions 143534 via svnmerge from
authorSteve Murphy <murf@digium.com>
Thu, 18 Sep 2008 23:41:33 +0000 (23:41 +0000)
committerSteve Murphy <murf@digium.com>
Thu, 18 Sep 2008 23:41:33 +0000 (23:41 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r143534 | murf | 2008-09-18 16:11:51 -0600 (Thu, 18 Sep 2008) | 1 line

A micro-fix, in sip_park_thread, where d is freed before the func is done using it.
........

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

channels/chan_sip.c

index ea1a0e3..7b1f0b1 100644 (file)
@@ -16259,12 +16259,12 @@ static void *sip_park_thread(void *stuff)
        transferee = d->chan1;
        transferer = d->chan2;
        copy_request(&req, &d->req);
        transferee = d->chan1;
        transferer = d->chan2;
        copy_request(&req, &d->req);
-       if (d->req.data)
-               ast_free(d->req.data);
-       ast_free(d);
 
        if (!transferee || !transferer) {
                ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" );
 
        if (!transferee || !transferer) {
                ast_log(LOG_ERROR, "Missing channels for parking! Transferer %s Transferee %s\n", transferer ? "<available>" : "<missing>", transferee ? "<available>" : "<missing>" );
+               if (d->req.data)
+                       ast_free(d->req.data);
+               free(d);
                return NULL;
        }
        ast_debug(4, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name);
                return NULL;
        }
        ast_debug(4, "SIP Park: Transferer channel %s, Transferee %s\n", transferer->name, transferee->name);
@@ -16274,6 +16274,9 @@ static void *sip_park_thread(void *stuff)
                ast_log(LOG_WARNING, "Masquerade failed.\n");
                transmit_response(transferer->tech_pvt, "503 Internal error", &req);
                ast_channel_unlock(transferee);
                ast_log(LOG_WARNING, "Masquerade failed.\n");
                transmit_response(transferer->tech_pvt, "503 Internal error", &req);
                ast_channel_unlock(transferee);
+               if (d->req.data)
+                       ast_free(d->req.data);
+               free(d);
                return NULL;
        } 
        ast_channel_unlock(transferee);
                return NULL;
        } 
        ast_channel_unlock(transferee);
@@ -16307,6 +16310,9 @@ static void *sip_park_thread(void *stuff)
                ast_debug(1, "SIP Call parked failed \n");
                /* Do not hangup call */
        }
                ast_debug(1, "SIP Call parked failed \n");
                /* Do not hangup call */
        }
+       if (d->req.data)
+               ast_free(d->req.data);
+       free(d);
        return NULL;
 }
 
        return NULL;
 }