mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
Check pointers before freeing (was getting WARNINGS under MALLOC_DEBUG)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3963,6 +3963,7 @@ void *ast_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
|
|||||||
|
|
||||||
void ast_yyfree (void * ptr , yyscan_t yyscanner)
|
void ast_yyfree (void * ptr , yyscan_t yyscanner)
|
||||||
{
|
{
|
||||||
|
if (ptr)
|
||||||
free( (char *) ptr ); /* see ast_yyrealloc() for (char *) cast */
|
free( (char *) ptr ); /* see ast_yyrealloc() for (char *) cast */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ static char *complete_fn(const char *word, int state)
|
|||||||
c += (strlen(ast_config_AST_MODULE_DIR) + 1);
|
c += (strlen(ast_config_AST_MODULE_DIR) + 1);
|
||||||
if (c)
|
if (c)
|
||||||
c = ast_strdup(c);
|
c = ast_strdup(c);
|
||||||
|
if (d)
|
||||||
free(d);
|
free(d);
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
|
|||||||
Reference in New Issue
Block a user