Project

General

Profile

Actions

Bug #13796

open

libuuid: map_state() leaks file when mmap() fails

Added by Marcel Telka about 1 year ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
lib - userland libraries
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When mmap() fails in map_state() the fd is not closed and leaks at line 273:

269      data = (shared_buffer_t *)mmap(NULL, sizeof (shared_buffer_t),
270          PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
271  
272      if (data == MAP_FAILED)
273          return (-1);
274  
275      (void) mutex_init(&data->lock, USYNC_PROCESS|LOCK_ROBUST, 0);
276  
277      (void) close(fd);
Actions

Also available in: Atom PDF