Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
belle-sip
Commits
491ba6f2
Commit
491ba6f2
authored
Sep 04, 2013
by
Simon Morlat
Browse files
improve logging, fix potential use of already freed pointer
parent
11d67d12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
src/belle_sip_object.c
src/belle_sip_object.c
+6
-1
src/message.c
src/message.c
+0
-2
src/transaction.c
src/transaction.c
+1
-2
No files found.
src/belle_sip_object.c
View file @
491ba6f2
...
...
@@ -67,7 +67,12 @@ belle_sip_object_t * belle_sip_object_ref(void *obj){
void
belle_sip_object_unref
(
void
*
ptr
){
belle_sip_object_t
*
obj
=
BELLE_SIP_OBJECT
(
ptr
);
if
(
obj
->
ref
==-
1
)
belle_sip_fatal
(
"Object with name [%s] freed twice !"
,
obj
->
name
);
if
(
obj
->
ref
==-
1
)
{
belle_sip_error
(
"Object [%p] freed twice !"
,
obj
);
if
(
obj
->
vptr
&&
obj
->
vptr
->
type_name
)
belle_sip_error
(
"Object type might be [%s]"
,
obj
->
vptr
->
type_name
);
belle_sip_fatal
(
"Fatal object error encountered, aborting."
);
return
;
}
if
(
obj
->
ref
==
0
&&
obj
->
pool
){
belle_sip_object_pool_remove
(
obj
->
pool
,
obj
);
obj
->
ref
=-
1
;
...
...
src/message.c
View file @
491ba6f2
...
...
@@ -300,10 +300,8 @@ void belle_sip_request_set_dialog(belle_sip_request_t *req, belle_sip_dialog_t *
if
(
dialog
)
belle_sip_object_ref
(
dialog
);
if
(
req
->
dialog
)
{
belle_sip_object_unref
(
req
->
dialog
);
req
->
dialog
=
NULL
;
}
req
->
dialog
=
dialog
;
}
void
belle_sip_request_set_uri
(
belle_sip_request_t
*
request
,
belle_sip_uri_t
*
uri
)
{
...
...
src/transaction.c
View file @
491ba6f2
...
...
@@ -111,13 +111,12 @@ void belle_sip_transaction_terminate(belle_sip_transaction_t *t){
,
belle_sip_request_get_method
(
belle_sip_transaction_get_request
(
t
))
,
t
);
BELLE_SIP_OBJECT_VPTR
(
t
,
belle_sip_transaction_t
)
->
on_terminate
(
t
);
belle_sip_provider_set_transaction_terminated
(
t
->
provider
,
t
);
/*remove reference to the dialog to avoid circular references*/
if
(
t
->
dialog
){
belle_sip_object_unref
(
t
->
dialog
);
t
->
dialog
=
NULL
;
}
belle_sip_provider_set_transaction_terminated
(
t
->
provider
,
t
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment