[Asterisk-code-review] loader: Minor fix to module registration. (asterisk[master])

Corey Farrell asteriskteam at digium.com
Thu Dec 14 17:55:31 CST 2017


Hello Richard Mudgett, Kevin Harwell, Jenkins2, Joshua Colp, 

I'd like you to reexamine a change. Please visit

    https://gerrit.asterisk.org/7518

to look at the new patch set (#2).

Change subject: loader: Minor fix to module registration.
......................................................................

loader: Minor fix to module registration.

This protects the module loader itself against crashing if dlopen is
called on a module from outside loader.c.

* Expand scope of lock inside ast_module_register to include reading of
  resource_being_loaded.
* NULL check resource_being_loaded.
* Set resource_being_loaded NULL as soon as dlopen returns.  This fixes
  some error paths where it was not NULL'ed.
* Create module_destroy function to deduplicate code from
  ast_module_unregister and modules_shutdown.
* Resolve leak that occured if a module did not successfully register.
* Simplify checking for successful registration.

Change-Id: I40f07a315e55b92df4fc7faf525ed6d4f396e7d2
---
M main/loader.c
1 file changed, 57 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/18/7518/2
-- 
To view, visit https://gerrit.asterisk.org/7518
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I40f07a315e55b92df4fc7faf525ed6d4f396e7d2
Gerrit-Change-Number: 7518
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171214/e927d5d7/attachment.html>


More information about the asterisk-code-review mailing list