[OpenSIPS-Devel] [OpenSIPS/opensips] 38e693: [tm] fixed double freeing on t_uac() callback param

Bogdan Andrei IANCU noreply at github.com
Mon Jan 16 12:23:29 UTC 2023


  Branch: refs/heads/3.2
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 38e693291a35e739b494668141032f27595610be
      https://github.com/OpenSIPS/opensips/commit/38e693291a35e739b494668141032f27595610be
  Author: Bogdan-Andrei Iancu <bogdan at opensips.org>
  Date:   2023-01-16 (Mon, 16 Jan 2023)

  Changed paths:
    M modules/tm/uac.c

  Log Message:
  -----------
  [tm] fixed double freeing on t_uac() callback param

If the t_uac() fails after the transaction was created (like it fails while trying to send the buffer out on the network), a double free will be done on the eventual callback func params: (1) via the released function attached to the completion callback (this will be automatically done upon free_cell() and (2) when t_uac() returns failure to the upper layer.

The fix is NOT to free the param if the t_uac() returns error. So even if the transaction was created, remove the release function on the callback func params, to prevent the free (1), and to allow the upper layer to do its own cleanup.

(cherry picked from commit 8448551cc4c1b6d4069790e54a149f4ffd0b4c47)





More information about the Devel mailing list