diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2021-01-29 14:00:30 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2021-01-29 14:00:30 +0100 |
commit | b46da88412444a7a22b7378402cabadf6689cea2 (patch) | |
tree | 0d7060265ba3e8f4193e00260c9bc6293353e501 | |
parent | e53ecd53bafbe2ee856ac4775b39679c5e5266f4 (diff) | |
download | dlfcn-win32-b46da88412444a7a22b7378402cabadf6689cea2.tar.gz dlfcn-win32-b46da88412444a7a22b7378402cabadf6689cea2.tar.bz2 dlfcn-win32-b46da88412444a7a22b7378402cabadf6689cea2.zip |
Remove duplicate checks for NULL pointers
is_valid_address() already rejects NULL addresses, so there is no need to check address for NULL.
-rw-r--r-- | src/dlfcn.c | 5 |
1 files changed, 1 insertions, 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 ) | |||
642 | DLFCN_EXPORT | 642 | DLFCN_EXPORT |
643 | int dladdr( void *addr, Dl_info *info ) | 643 | int dladdr( void *addr, Dl_info *info ) |
644 | { | 644 | { |
645 | if( addr == NULL || info == NULL ) | 645 | if( info == NULL ) |
646 | return 0; | 646 | return 0; |
647 | 647 | ||
648 | if( !is_valid_address( addr ) ) | 648 | if( !is_valid_address( addr ) ) |
@@ -678,9 +678,6 @@ int dladdr( void *addr, Dl_info *info ) | |||
678 | 678 | ||
679 | addr = get_address_from_import_address_table( iat, iatSize, addr ); | 679 | addr = get_address_from_import_address_table( iat, iatSize, addr ); |
680 | 680 | ||
681 | if( addr == NULL ) | ||
682 | return 0; | ||
683 | |||
684 | if( !is_valid_address( addr ) ) | 681 | if( !is_valid_address( addr ) ) |
685 | return 0; | 682 | return 0; |
686 | } | 683 | } |