Check pointers before freeing (was getting WARNINGS under MALLOC_DEBUG)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97825 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
45f02f8778
commit
3d2e5fea00
|
@ -3963,6 +3963,7 @@ void *ast_yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
|
|||
|
||||
void ast_yyfree (void * ptr , yyscan_t yyscanner)
|
||||
{
|
||||
if (ptr)
|
||||
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);
|
||||
if (c)
|
||||
c = ast_strdup(c);
|
||||
if (d)
|
||||
free(d);
|
||||
|
||||
return c;
|
||||
|
|
Reference in New Issue