aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-19 22:32:07 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-04-19 22:32:07 +0000
commit5141b946172efc9288510ecca930fc686c3bc21b (patch)
tree33fa1d74a0acd3e0378be5522d860827aaa25e05
parent7e5f8397c920614af96a4510da9ea06b84064201 (diff)
add the malloc attribute to the memory allocation wrappers
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@21681 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--include/asterisk/utils.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h
index 35f2539ef..9a61f573b 100644
--- a/include/asterisk/utils.h
+++ b/include/asterisk/utils.h
@@ -266,7 +266,7 @@ long int ast_random(void);
_ast_malloc((len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-void *_ast_malloc(size_t len, const char *file, int lineno, const char *func),
+void * __attribute__((malloc)) _ast_malloc(size_t len, const char *file, int lineno, const char *func),
{
void *p;
@@ -291,7 +291,7 @@ void *_ast_malloc(size_t len, const char *file, int lineno, const char *func),
_ast_calloc((num), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-void *_ast_calloc(size_t num, size_t len, const char *file, int lineno, const char *func),
+void * __attribute__((malloc)) _ast_calloc(size_t num, size_t len, const char *file, int lineno, const char *func),
{
void *p;
@@ -316,7 +316,7 @@ void *_ast_calloc(size_t num, size_t len, const char *file, int lineno, const ch
_ast_realloc((p), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-void *_ast_realloc(void *p, size_t len, const char *file, int lineno, const char *func),
+void * __attribute__((malloc)) _ast_realloc(void *p, size_t len, const char *file, int lineno, const char *func),
{
void *newp;
@@ -345,7 +345,7 @@ void *_ast_realloc(void *p, size_t len, const char *file, int lineno, const char
_ast_strdup((str), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-char *_ast_strdup(const char *str, const char *file, int lineno, const char *func),
+char * __attribute__((malloc)) _ast_strdup(const char *str, const char *file, int lineno, const char *func),
{
char *newstr = NULL;
@@ -376,7 +376,7 @@ char *_ast_strdup(const char *str, const char *file, int lineno, const char *fun
_ast_strndup((str), (len), __FILE__, __LINE__, __PRETTY_FUNCTION__)
AST_INLINE_API(
-char *_ast_strndup(const char *str, size_t len, const char *file, int lineno, const char *func),
+char * __attribute__((malloc)) _ast_strndup(const char *str, size_t len, const char *file, int lineno, const char *func),
{
char *newstr = NULL;