mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	Make some notes about common usage of pbx_builtin_getvar_helper() that is not
thread-safe. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@111909 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -1,3 +1,15 @@ | ||||
|  -- There a bunch of places where the result of pbx_builtin_getvar_helper() | ||||
|     gets stored and used.  This is not threadsafe.  This code should be replaced | ||||
| 	with the following thread-safe version: | ||||
|  | ||||
| 	const char *var; | ||||
|  | ||||
| 	ast_channel_lock(chan); | ||||
| 	if ((var = pbx_builtin_getvar_helper(chan, "MYVAR"))) { | ||||
| 		var = ast_strdupa(var); | ||||
| 	} | ||||
| 	ast_channel_unlock(chan); | ||||
|  | ||||
|  -- Convert all existing uses of astobj.h to astobj2.h | ||||
|     -- (chan_sip already in progress in a branch) | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user