mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-13 04:10:13 +00:00
broadway: Fix memleak in error case
https://bugzilla.gnome.org/show_bug.cgi?id=751752
This commit is contained in:
parent
15c73a2b1a
commit
ef93c714f8
@ -827,7 +827,7 @@ map_named_shm (char *name, gsize size)
|
||||
void *ptr;
|
||||
char *filename = NULL;
|
||||
|
||||
fd = shm_open(name, O_RDONLY, 0600);
|
||||
fd = shm_open (name, O_RDONLY, 0600);
|
||||
if (fd == -1)
|
||||
{
|
||||
filename = g_build_filename (g_get_tmp_dir (), name, NULL);
|
||||
@ -835,13 +835,15 @@ map_named_shm (char *name, gsize size)
|
||||
if (fd == -1)
|
||||
{
|
||||
perror ("Failed to map shm");
|
||||
g_free (filename);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ptr = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
ptr = mmap (0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
|
||||
(void) close(fd);
|
||||
(void) close (fd);
|
||||
|
||||
if (filename)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user