mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +00:00
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
This commit is contained in:
@@ -807,15 +807,7 @@ void *ast_sorcery_alloc(const struct ast_sorcery *sorcery, const char *type, con
|
||||
}
|
||||
|
||||
if (ast_strlen_zero(id)) {
|
||||
struct ast_uuid *uuid = ast_uuid_generate();
|
||||
|
||||
if (!uuid) {
|
||||
ao2_ref(details, -1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ast_uuid_to_str(uuid, details->id, AST_UUID_STR_LEN);
|
||||
ast_free(uuid);
|
||||
ast_uuid_generate_str(details->id, sizeof(details->id));
|
||||
} else {
|
||||
ast_copy_string(details->id, id, sizeof(details->id));
|
||||
}
|
||||
|
Reference in New Issue
Block a user