A couple minor cleanup tweaks.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 25 Mar 2015 18:37:51 +0000 (18:37 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 25 Mar 2015 18:37:51 +0000 (18:37 +0000)
* In res/res_sorcery_realtime.c: Broke long line.

* In main/bucket.c: Eliminated unnecessary NULL check as
ast_sorcery_unref() is NULL tolerant and set the global object to NULL
after unref in the system shutdown bucket_cleanup().
........

Merged revisions 433420 from http://svn.asterisk.org/svn/asterisk/branches/13

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

main/bucket.c
res/res_sorcery_realtime.c

index 90397f1..7618761 100644 (file)
@@ -882,9 +882,8 @@ static int bucket_scheme_cmp(void *obj, void *arg, int flags)
 /*! \brief Cleanup function for graceful shutdowns */
 static void bucket_cleanup(void)
 {
-       if (bucket_sorcery) {
-               ast_sorcery_unref(bucket_sorcery);
-       }
+       ast_sorcery_unref(bucket_sorcery);
+       bucket_sorcery = NULL;
 
        ast_sorcery_wizard_unregister(&bucket_wizard);
        ast_sorcery_wizard_unregister(&bucket_file_wizard);
index 52b097f..fcdc2a9 100644 (file)
@@ -158,7 +158,9 @@ static void *sorcery_realtime_retrieve_fields(const struct ast_sorcery *sorcery,
 
        objectset = sorcery_realtime_filter_objectset(objectset, &id, sorcery, type);
 
-       if (!id || !(object = ast_sorcery_alloc(sorcery, type, id->value)) || ast_sorcery_objectset_apply(sorcery, object, objectset)) {
+       if (!id
+               || !(object = ast_sorcery_alloc(sorcery, type, id->value))
+               || ast_sorcery_objectset_apply(sorcery, object, objectset)) {
                return NULL;
        }