mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	MALLOC_DEBUG: Fix some misuses of free() when MALLOC_DEBUG is enabled.
* There were several places in ARI where an external library was mallocing memory that must always be released with free(). When MALLOC_DEBUG is enabled, free() is redirected to the MALLOC_DEBUG version. Since the external library call still uses the normal malloc(), MALLOC_DEBUG complains that the freed memory block is not registered and will not free it. These cases must use ast_std_free(). * Changed calls to asprintf() and vasprintf() to the equivalent ast_asprintf() and ast_vasprintf() versions respectively. ........ Merged revisions 400270 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -1215,8 +1215,7 @@ static int handle_gosub(struct ast_channel *chan, AGI *agi, int argc, const char | ||||
| 		ast_agi_send(agi->fd, chan, "200 result=%d Gosub failed\n", res); | ||||
| 	} | ||||
|  | ||||
| 	/* Must use free because the memory was allocated by asprintf(). */ | ||||
| 	free(gosub_args); | ||||
| 	ast_free(gosub_args); | ||||
|  | ||||
| 	ast_channel_lock(chan); | ||||
| 	ast_debug(4, "%s Ending location: %s,%s,%d\n", ast_channel_name(chan), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user