dect
/
asterisk
Archived
13
0
Fork 0

Merged revisions 273565 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r273565 | russell | 2010-07-01 17:09:19 -0500 (Thu, 01 Jul 2010) | 7 lines
  
  Don't return a partially initialized datastore.
  
  If memory allocation fails in ast_strdup(), don't return a partially
  initialized datastore.  Bad things may happen.
  
  (related to ABE-2415)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@273566 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
russell 2010-07-01 22:16:23 +00:00
parent f57bd9716b
commit 75e7a3bc76
1 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,10 @@ struct ast_datastore *__ast_datastore_alloc(const struct ast_datastore_info *inf
datastore->info = info;
datastore->uid = ast_strdup(uid);
if (!ast_strlen_zero(uid) && !(datastore->uid = ast_strdup(uid))) {
ast_free(datastore);
datastore = NULL;
}
return datastore;
}