Bug #6167

Updated by Marcel Telka almost 6 years ago

While walking through the code I noticed the following in libshare_nfs.c: 

 897 		 if (exp->ex_flags != NULL) 
 898 			 free(exp->ex_tag); 
 899 		 if (exp->ex_log_buffer != NULL) 
 900 			 free(exp->ex_log_buffer); 

 The author of the code very likely wanted to use exp->ex_tag instead of exp->ex_flags at line 897.    With the current code in a case the ex_flags is zero and ex_tag is non-null we will see a leak. 

 To fix this issue the code above could be safely changed to: 

 897 		 free(exp->ex_tag); 
 898 		 free(exp->ex_log_buffer);