Whamcloud - gitweb
create_inode: remove backup definition of __func__
[tools/e2fsprogs.git] / misc / e4defrag.c
index d0eac60..3f949d0 100644 (file)
@@ -387,8 +387,10 @@ static int page_in_core(int fd, struct move_extent defrag_data,
        *page_num = 0;
        *page_num = (length + pagesize - 1) / pagesize;
        *vec = (unsigned char *)calloc(*page_num, 1);
-       if (*vec == NULL)
+       if (*vec == NULL) {
+               munmap(page, length);
                return -1;
+       }
 
        /* Get information on whether pages are in core */
        if (mincore(page, (size_t)length, *vec) == -1 ||