Skip to content
Success

Changes

Summary

  1. stream: Allow null ptr in destroy() functions (details)
  2. stream_cli: steal talloc ctx upon delaying free to avoid use after free (details)
Commit 17dcd93eb70d0944411705f6d8200c5a2d76f871 by Pau Espin Pedrol
stream: Allow null ptr in destroy() functions

It's common pattern that free/destroy functions allow NULL pointers.
Let's accept it here to make life easier for users.

Change-Id: I99e23db6617af8261b512efffc62336b63b38516
The file was modifiedsrc/stream_cli.c
The file was modifiedsrc/stream_srv.c
Commit 66990f8a0b4e8a2e3ace415b38a453a8b44e194f by Pau Espin Pedrol
stream_cli: steal talloc ctx upon delaying free to avoid use after free

Scenario:
read_cb()
  [user code] osmo_stream_cli_destroy()
   stream_cli_close()
    disconnect_cb()
   (free is delayed because we are in cb)
   [user code] (frees parent struct of "cli", which would free cli)
free_delayed_if_needed() called on an already freed poiter
Fixes: a6af7cb9dce9d4567d355bad873c60be68896eee
Related: OS#6651
Change-Id: Id7625558d4b1343d621fb51406fa7f841db864ee
The file was modifiedsrc/stream_cli.c