|  | @@ -145,6 +145,8 @@ static void nfs_done ( struct nfs_request *nfs, int rc ) {
 | 
		
	
		
			
			| 145 | 145 |  
 | 
		
	
		
			
			| 146 | 146 |  	DBGC ( nfs, "NFS_OPEN %p completed (%s)\n", nfs, strerror ( rc ) );
 | 
		
	
		
			
			| 147 | 147 |  
 | 
		
	
		
			
			|  | 148 | +	free ( nfs->filename );
 | 
		
	
		
			
			|  | 149 | +
 | 
		
	
		
			
			| 148 | 150 |  	intf_shutdown ( &nfs->xfer, rc );
 | 
		
	
		
			
			| 149 | 151 |  	intf_shutdown ( &nfs->pm_intf, rc );
 | 
		
	
		
			
			| 150 | 152 |  	intf_shutdown ( &nfs->mount_intf, rc );
 | 
		
	
	
		
			
			|  | @@ -334,6 +336,15 @@ static int nfs_mount_deliver ( struct nfs_request *nfs,
 | 
		
	
		
			
			| 334 | 336 |  			goto done;
 | 
		
	
		
			
			| 335 | 337 |  		}
 | 
		
	
		
			
			| 336 | 338 |  
 | 
		
	
		
			
			|  | 339 | +		/* We need to strdup() nfs->filename since the code handling
 | 
		
	
		
			
			|  | 340 | +		 * symlink resolution make the assumption that it can be
 | 
		
	
		
			
			|  | 341 | +		 * free()ed. */
 | 
		
	
		
			
			|  | 342 | +		if ( ( nfs->filename = strdup ( nfs->filename ) ) == NULL )
 | 
		
	
		
			
			|  | 343 | +		{
 | 
		
	
		
			
			|  | 344 | +			rc = -ENOMEM;
 | 
		
	
		
			
			|  | 345 | +			goto err;
 | 
		
	
		
			
			|  | 346 | +		}
 | 
		
	
		
			
			|  | 347 | +
 | 
		
	
		
			
			| 337 | 348 |  		nfs->current_fh = mnt_reply.fh;
 | 
		
	
		
			
			| 338 | 349 |  		nfs->nfs_state = NFS_LOOKUP;
 | 
		
	
		
			
			| 339 | 350 |  		nfs_step ( nfs );
 |