[Freeswitch-svn] [commit] r7364 - freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su
Freeswitch SVN
mikej at freeswitch.org
Fri Jan 25 20:41:02 EST 2008
Author: mikej
Date: Fri Jan 25 20:41:02 2008
New Revision: 7364
Modified:
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c
Log:
try to not segfault
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_alloc.c Fri Jan 25 20:41:02 2008
@@ -780,7 +780,8 @@
*/
void su_free(su_home_t *home, void *data)
{
- if (home && data) {
+ if (data) {
+ if (home) {
su_alloc_t *allocation;
su_block_t *sub = MEMLOCK(home);
@@ -825,6 +826,7 @@
}
free(data);
+ }
}
/** Check home consistency.
Modified: freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c
==============================================================================
--- freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c (original)
+++ freeswitch/trunk/libs/sofia-sip/libsofia-sip-ua/su/su_root.c Fri Jan 25 20:41:02 2008
@@ -1046,19 +1046,19 @@
*/
void su_msg_destroy(su_msg_r rmsg)
{
+ su_msg_t *msg = rmsg[0];
assert(rmsg);
+ rmsg[0] = NULL;
- if (rmsg[0]) {
- SU_TASK_ZAP(rmsg[0]->sum_to, su_msg_destroy);
- SU_TASK_ZAP(rmsg[0]->sum_from, su_msg_destroy);
+ if (msg) {
+ SU_TASK_ZAP(msg->sum_to, su_msg_destroy);
+ SU_TASK_ZAP(msg->sum_from, su_msg_destroy);
- if (rmsg[0]->sum_deinit)
- rmsg[0]->sum_deinit(rmsg[0]->sum_data);
+ if (msg->sum_deinit)
+ msg->sum_deinit(msg->sum_data);
- su_free(NULL, rmsg[0]);
+ su_free(NULL, msg);
}
-
- rmsg[0] = NULL;
}
/** Gets a pointer to the message data area.
More information about the Freeswitch-svn
mailing list