Check-in [457d68de44]
Overview
Comment:Close cache file if we cannot duplicate it
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:457d68de446ec16e180a4b787d8cb79ae1c1d5a6
User & Date: rkeene on 2020-04-21 13:12:37
Other Links: manifest | tags
Context
2020-04-21
13:12
Close cache file if we cannot duplicate it Leaf check-in: 457d68de44 user: rkeene tags: trunk
2020-04-02
15:49
More inputs to AFL check-in: abedee59bf user: rkeene tags: trunk
Changes

Modified filed.c from [e0a9bfdbe7] to [d39c0feefb].

   995    995   	if (filed_fileinfo_fdcache_size != 0) {
   996    996   		/*
   997    997   		 * We have to make a duplicate FD, because once we release the cache
   998    998   		 * mutex, the file descriptor may be closed
   999    999   		 */
  1000   1000   		fd = dup(cache->fd);
  1001   1001   		if (fd < 0) {
         1002  +			close(cache->fd);
         1003  +			cache->fd = -1;
         1004  +
  1002   1005   			pthread_mutex_unlock(&cache->mutex);
  1003   1006   
  1004   1007   			return(NULL);
  1005   1008   		}
  1006   1009   
  1007   1010   		buffer->fd = fd;
  1008   1011   		buffer->len = cache->len;