func_periodic_hook: move module ref
authorRussell Bryant <russell@russellbryant.com>
Sat, 12 Apr 2014 01:35:34 +0000 (01:35 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 12 Apr 2014 01:35:34 +0000 (01:35 +0000)
commit39ba6a16f5c0fd1fe40a41d7102b057ef3490a9e
tree13ebfe8099e0fceaeaf957e3f61b4a9e25ef841b
parent23329d07cf8107f3c2990b20f53e10f5487d60b0
func_periodic_hook: move module ref

The previous code left one error path where the module would be unref'd twice
instead of once.  It was done once in the error handling block, and again inside
of datastore destruction.

Now the module ref is only released in the datastore destructor and only acquired
when the datastore has been successfully allocated.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
funcs/func_periodic_hook.c