I changed this code earlier to return NULL if it wasn't able to generate a UUID,
whereas the earlier code would always return the ast_str that was passed in.
Switch back to returning the ast_str, only set it to the empty string instead if
UUID generation fails. We still do a validity check later which will catch this
and blow up if necessary.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@378000
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
struct ast_uuid *uuid = ast_uuid_generate();
if (!uuid) {
- return NULL;
+ ast_str_set(&uid, 0, "%s", "");
+ return uid;
}
ast_str_set(&uid, 0, "%s", ast_uuid_to_str(uuid, buffer, AST_UUID_STR_LEN));