[svn-commits] russell: branch 1.6.2 r273571 - in /branches/1.6.2: ./ main/datastore.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jul 1 17:18:01 CDT 2010


Author: russell
Date: Thu Jul  1 17:17:57 2010
New Revision: 273571

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=273571
Log:
Merged revisions 273566 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r273566 | russell | 2010-07-01 17:16:23 -0500 (Thu, 01 Jul 2010) | 14 lines
  
  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)
  ........
................

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/datastore.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/datastore.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/datastore.c?view=diff&rev=273571&r1=273570&r2=273571
==============================================================================
--- branches/1.6.2/main/datastore.c (original)
+++ branches/1.6.2/main/datastore.c Thu Jul  1 17:17:57 2010
@@ -50,7 +50,10 @@
 
 	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;
 }




More information about the svn-commits mailing list