Uthernet: avoid assertions or memory errors in some corner cases.
1) tfe_deactivate_i: there is no need to check as the code can be called anyway. This happens is the interface could not be opened properly (lack of capabilities) 2) tfe_shutdown: free() can alreayd handle NULL. Correctly mark the pointer as freed.
This commit is contained in:
parent
e4a91e084d
commit
b1e431d17d
1 changed files with 2 additions and 4 deletions
|
@ -535,8 +535,6 @@ int tfe_deactivate_i(void)
|
|||
if(g_fh) fprintf( g_fh, "tfe_deactivate_i()." );
|
||||
#endif
|
||||
|
||||
assert(tfe && tfe_packetpage);
|
||||
|
||||
tfe_arch_deactivate();
|
||||
|
||||
lib_free(tfe);
|
||||
|
@ -602,8 +600,8 @@ void tfe_shutdown(void)
|
|||
if (tfe)
|
||||
tfe_deactivate();
|
||||
|
||||
if (tfe_interface != NULL)
|
||||
lib_free(tfe_interface);
|
||||
lib_free(tfe_interface);
|
||||
tfe_interface = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue