bucket: Fix scheme ref leak in __ast_bucket_scheme_register().
authorRichard Mudgett <rmudgett@digium.com>
Thu, 21 Nov 2013 18:11:04 +0000 (18:11 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 21 Nov 2013 18:11:04 +0000 (18:11 +0000)
........

Merged revisions 402944 from http://svn.asterisk.org/svn/asterisk/branches/12

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

main/bucket.c

index 8f6acda..10d230b 100644 (file)
@@ -254,7 +254,7 @@ int __ast_bucket_scheme_register(const char *name, struct ast_sorcery_wizard *bu
        bucket_file_destroy_cb destroy_cb, struct ast_module *module)
 {
        SCOPED_AO2WRLOCK(lock, schemes);
-       struct ast_bucket_scheme *scheme;
+       RAII_VAR(struct ast_bucket_scheme *, scheme, NULL, ao2_cleanup);
 
        if (ast_strlen_zero(name) || !bucket || !file ||
            !bucket->create || !bucket->delete || !bucket->retrieve_id ||