[asterisk-commits] russell: trunk r273566 - in /trunk: ./ main/datastore.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 1 17:16:26 CDT 2010


Author: russell
Date: Thu Jul  1 17:16:23 2010
New Revision: 273566

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=273566
Log:
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:
    trunk/   (props changed)
    trunk/main/datastore.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/main/datastore.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/datastore.c?view=diff&rev=273566&r1=273565&r2=273566
==============================================================================
--- trunk/main/datastore.c (original)
+++ trunk/main/datastore.c Thu Jul  1 17:16:23 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 asterisk-commits mailing list