coredump: fix memleak in dump_vma_snapshot()
[linux-2.6-microblaze.git] / fs / coredump.c
index 4b3c757..3224dee 100644 (file)
@@ -1134,8 +1134,10 @@ int dump_vma_snapshot(struct coredump_params *cprm, int *vma_count,
 
        mmap_write_unlock(mm);
 
-       if (WARN_ON(i != *vma_count))
+       if (WARN_ON(i != *vma_count)) {
+               kvfree(*vma_meta);
                return -EFAULT;
+       }
 
        *vma_data_size_ptr = vma_data_size;
        return 0;