@@ -812,6 +812,9 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
812812 return  NGX_ERROR ;
813813 }
814814
815+ #if  __FreeBSD__ 
816+  (void ) dlerror ();
817+ #endif 
815818 /* * check init function block, this version has to be at least init with empty function * */ 
816819 ngx_http_link_func_app_cycle_handler  func ;
817820 * (void * * )(& func ) =  dlsym (scf -> _app , (const  char * )"ngx_link_func_init_cycle" );
@@ -821,6 +824,11 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
821824 & scf -> _libname , error );
822825 return  NGX_ERROR ;
823826 }
827+ 828+ #if  __FreeBSD__ 
829+  (void ) dlerror ();
830+ #endif 
831+ 824832 * (void * * )(& func ) =  dlsym (scf -> _app , (const  char * )"ngx_link_func_exit_cycle" );
825833 if  ((error  =  dlerror ()) !=  NULL ) {
826834 ngx_conf_log_error (NGX_LOG_ERR , cf , 0 ,
@@ -838,6 +846,11 @@ ngx_http_link_func_application_compatibility_check(ngx_conf_t *cf, ngx_http_core
838846
839847 ngx_http_link_func_loc_conf_t  * lcf  =  cflq -> _loc_conf ;
840848 if  ( lcf  &&  lcf -> _method_name .len  >  0  ) {
849+ 850+ #if  __FreeBSD__ 
851+  (void ) dlerror ();
852+ #endif 
853+ 841854 * (void * * )(& lcf -> _handler ) =  dlsym (scf -> _app , (const  char * )lcf -> _method_name .data );
842855 if  ((error  =  dlerror ()) !=  NULL ) {
843856 ngx_conf_log_error (NGX_LOG_EMERG , cf , 0 , "Error function load: %s" , error );
0 commit comments