]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal/mmap-cache.c
tree-wide: use mfree more
[thirdparty/systemd.git] / src / journal / mmap-cache.c
index 6bcd9b6ac84782a6c8d77732f32a00d0dd04394a..d91247b52449988c91bc74507b218f03b1e9cf41 100644 (file)
@@ -325,10 +325,8 @@ static FileDescriptor* fd_add(MMapCache *m, int fd) {
         f->fd = fd;
 
         r = hashmap_put(m->fds, FD_TO_PTR(fd), f);
-        if (r < 0) {
-                free(f);
-                return NULL;
-        }
+        if (r < 0)
+                return mfree(f);
 
         return f;
 }
@@ -481,7 +479,7 @@ static int mmap_try_harder(MMapCache *m, void *addr, int fd, int prot, int flags
                 if (ptr != MAP_FAILED)
                         break;
                 if (errno != ENOMEM)
-                        return -errno;
+                        return negative_errno();
 
                 r = make_room(m);
                 if (r < 0)
@@ -571,7 +569,7 @@ static int add_mmap(
         return 1;
 
 outofmem:
-        munmap(d, wsize);
+        (void) munmap(d, wsize);
         return -ENOMEM;
 }