Automatic memory management and less error prone as it avoids manual
pointer manipulations.
No functional change.
Change-Id: Id35f4e4dc8918436589001db4acdf55ff9c60e5f
Use references instead of pointers.
Use object operators instead of memcpy and memset.
Remove redundant ctors.
Change-Id: I04440450070af17909efbd957f42a3c561e658ab
Use shared_ptr for automatic reference counting of sockets, instead of
doing it manually through atomic_ref_cnt.
Use shared_ptr instead of raw pointers in all appropriate places.
Add const qualifier for a few methods.
No functional change.
Change-Id: I7db07fd90a2398f0253290aa2d810f8599e3983e
Reverse inheritence between singleton class and its base.
Change singleton template so that the singleton class doesn't inherit
from its base, but rather that the singelton class inherits from the
singleton template. This removes the need to keep the singleton base
classes separate (with the underscore prefix) plus a `typedef` for the
singleton class, and instead makes the class itself become the
singleton. (The exception being intermediate classes that have multiple
other derived classes, which is only the wheeltimer).
This makes for cleaner typing, but requires use of listing the singleton
template as friend class.
No functional changes.
Change-Id: Ic45cb01f7870ce0ba97188e58340b10fdc0380cb
The memory referenced via it could have been freed already
(by the `update_uac_request()`). Set the original pointer to NULL
and check in the caller's function if it has been assigned to NULL
before actually using.
Fixes:
Read from pointer after free (USE_AFTER_FREE)
41. deref_after_free: Dereferencing freed pointer p_msg.
Change-Id: I07ee9360f996c8723ba46c99f512ef9562ff75c3
To be able to set msg's ptr to NULL in the `update_uac_request()`
after the memory referenced via it is freed.
Change-Id: Id8d89a6a64b78e5fd06d43e0b99aaf83c4623908
Eliminate the `auto_ptr` usage for core/* ,
since this pointer type has been deprecated in C++11.
Use, as recommended, `unique_ptr` instead.
Change-Id: I352e03bd0c8401d9a4890d8a1845913e4c22dab3
Filtering by transaction type in trans_table::match_request() is necessary to avoid matching the ACK/200 UAC transaction when receiving a self-crafted ACK/200 and looking for the UAS transaction.
PRACK should be first matched using normal transaction matching to identify retransmissions. Then, it can be matched against the original INVITE transaction to disable the re-transmission timers.