From b46da88412444a7a22b7378402cabadf6689cea2 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Fri, 29 Jan 2021 14:00:30 +0100 Subject: Remove duplicate checks for NULL pointers is_valid_address() already rejects NULL addresses, so there is no need to check address for NULL. --- src/dlfcn.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/dlfcn.c b/src/dlfcn.c index 2b2ea07..abbd58d 100644 --- a/src/dlfcn.c +++ b/src/dlfcn.c @@ -642,7 +642,7 @@ static BOOL fill_info( void *addr, Dl_info *info ) DLFCN_EXPORT int dladdr( void *addr, Dl_info *info ) { - if( addr == NULL || info == NULL ) + if( info == NULL ) return 0; if( !is_valid_address( addr ) ) @@ -678,9 +678,6 @@ int dladdr( void *addr, Dl_info *info ) addr = get_address_from_import_address_table( iat, iatSize, addr ); - if( addr == NULL ) - return 0; - if( !is_valid_address( addr ) ) return 0; } -- cgit v1.2.3-55-g6feb