btrfs-progs: check: Fix heap use after free
[platform/upstream/btrfs-progs.git] / btrfs-map-logical.c
index f3be1ea..e856b69 100644 (file)
@@ -29,8 +29,9 @@
 #include "transaction.h"
 #include "list.h"
 #include "utils.h"
+#include "help.h"
 
-#define BUFFER_SIZE (64 * 1024)
+#define BUFFER_SIZE SZ_64K
 
 /* we write the mirror info to stdout unless they are dumping the data
  * to stdout
@@ -125,7 +126,7 @@ static int __print_mapping_info(struct btrfs_fs_info *fs_info, u64 logical,
                                multi->stripes[0].physical,
                                device->name);
                }
-               kfree(multi);
+               free(multi);
                multi = NULL;
                cur_offset += cur_len;
        }