mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-29 23:39:35 +00:00 
			
		
		
		
	use ast_malloc instead of malloc
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@24880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		
							
								
								
									
										4
									
								
								utils.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								utils.c
									
									
									
									
									
								
							| @@ -781,7 +781,7 @@ size_t strnlen(const char *s, size_t n) | |||||||
| char *strndup(const char *s, size_t n) | char *strndup(const char *s, size_t n) | ||||||
| { | { | ||||||
| 	size_t len = strnlen(s, n); | 	size_t len = strnlen(s, n); | ||||||
| 	char *new = malloc(len + 1); | 	char *new = ast_malloc(len + 1); | ||||||
|  |  | ||||||
| 	if (!new) | 	if (!new) | ||||||
| 		return NULL; | 		return NULL; | ||||||
| @@ -802,7 +802,7 @@ int vasprintf(char **strp, const char *fmt, va_list ap) | |||||||
| 	va_copy(ap2, ap); | 	va_copy(ap2, ap); | ||||||
| 	size = vsnprintf(&s, 1, fmt, ap2); | 	size = vsnprintf(&s, 1, fmt, ap2); | ||||||
| 	va_end(ap2); | 	va_end(ap2); | ||||||
| 	*strp = malloc(size + 1); | 	*strp = ast_malloc(size + 1); | ||||||
| 	if (!*strp) | 	if (!*strp) | ||||||
| 		return -1; | 		return -1; | ||||||
| 	vsnprintf(*strp, size + 1, fmt, ap); | 	vsnprintf(*strp, size + 1, fmt, ap); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user