diff options
author | Richard Mudgett <rmudgett@digium.com> | 2013-03-28 23:59:20 +0000 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2013-03-28 23:59:20 +0000 |
commit | a1c94fece82f2445e538de0c93345d34c4abdf17 (patch) | |
tree | 5e1f771efae1c221db8ecc3efaa4eb00632e19d8 /res/res_sorcery_config.c | |
parent | 71206544a770eb4004294ed13613a7cde6e0e056 (diff) |
Add uuid wrapper API call ast_uuid_generate_str().
* Updated test_uuid.c to test the new API call.
* Made system use the new API call to eliminate "10's of lines" where
used.
* Fixed untested ast_strdup() return in stasis_subscribe() by eliminating
the need for it. struct stasis_subscription now contains the uniqueid[]
string.
* Fixed some issues in exchangecal_write_event():
Create uid with enough space for a UUID string to avoid a realloc.
Fix off by one error if the calendar event provided a UUID string.
There is no need to check for NULL before calling ast_free().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_sorcery_config.c')
-rw-r--r-- | res/res_sorcery_config.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/res/res_sorcery_config.c b/res/res_sorcery_config.c index 10347ea81..509538f5a 100644 --- a/res/res_sorcery_config.c +++ b/res/res_sorcery_config.c @@ -305,19 +305,12 @@ static void *sorcery_config_open(const char *data) { char *tmp = ast_strdupa(data), *filename = strsep(&tmp, ","), *option; struct sorcery_config *config; - struct ast_uuid *uuid; if (ast_strlen_zero(filename) || !(config = ao2_alloc_options(sizeof(*config) + strlen(filename) + 1, sorcery_config_destructor, AO2_ALLOC_OPT_LOCK_NOLOCK))) { return NULL; } - if (!(uuid = ast_uuid_generate())) { - ao2_ref(config, -1); - return NULL; - } - - ast_uuid_to_str(uuid, config->uuid, AST_UUID_STR_LEN); - ast_free(uuid); + ast_uuid_generate_str(config->uuid, sizeof(config->uuid)); ast_rwlock_init(&config->objects.lock); config->buckets = DEFAULT_OBJECT_BUCKETS; |