@ -4591,10 +4591,6 @@ static int ext_strncpy(char *dst, const char *src, int len)
return count ;
return count ;
}
}
static void null_datad ( void * foo )
{
}
/*! \brief add the extension in the priority chain.
/*! \brief add the extension in the priority chain.
* returns 0 on success , - 1 on failure
* returns 0 on success , - 1 on failure
*/
*/
@ -4616,7 +4612,8 @@ static int add_pri(struct ast_context *con, struct ast_exten *tmp,
replacement ? If so , replace , otherwise , bonk . */
replacement ? If so , replace , otherwise , bonk . */
if ( ! replace ) {
if ( ! replace ) {
ast_log ( LOG_WARNING , " Unable to register extension '%s', priority %d in '%s', already in use \n " , tmp - > exten , tmp - > priority , con - > name ) ;
ast_log ( LOG_WARNING , " Unable to register extension '%s', priority %d in '%s', already in use \n " , tmp - > exten , tmp - > priority , con - > name ) ;
tmp - > datad ( tmp - > data ) ;
if ( tmp - > datad )
tmp - > datad ( tmp - > data ) ;
free ( tmp ) ;
free ( tmp ) ;
return - 1 ;
return - 1 ;
}
}
@ -4634,7 +4631,8 @@ static int add_pri(struct ast_context *con, struct ast_exten *tmp,
if ( tmp - > priority = = PRIORITY_HINT )
if ( tmp - > priority = = PRIORITY_HINT )
ast_change_hint ( e , tmp ) ;
ast_change_hint ( e , tmp ) ;
/* Destroy the old one */
/* Destroy the old one */
e - > datad ( e - > data ) ;
if ( e - > datad )
e - > datad ( e - > data ) ;
free ( e ) ;
free ( e ) ;
} else { /* Slip ourselves in just before e */
} else { /* Slip ourselves in just before e */
tmp - > peer = e ;
tmp - > peer = e ;
@ -4718,8 +4716,6 @@ int ast_add_extension2(struct ast_context *con,
length + + ; /* just the '\0' */
length + + ; /* just the '\0' */
/* Be optimistic: Build the extension structure first */
/* Be optimistic: Build the extension structure first */
if ( datad = = NULL )
datad = null_datad ;
if ( ! ( tmp = ast_calloc ( 1 , length ) ) )
if ( ! ( tmp = ast_calloc ( 1 , length ) ) )
return - 1 ;
return - 1 ;