Skip to contentSkip to conversation

disk-io.c (open_ctree): avoid leaks

PATCH Jim Meyering 1 participant 1 message Sep 9, 2008 Btrfs file system

lore
Share & tools
lore
#0 lore raw

These two variables (chunk_root and dev_root) that were not tested for failed allocation weren't freed-upon-failure either:

changeset:   709:c40da2ab8c03
tag:         tip
user:        Jim Meyering <[email protected]>
date:        Tue Sep 09 16:35:47 2008 +0200
files:       disk-io.c

description:
disk-io.c (open_ctree): avoid leaks

disk-io.c +2 -0
@@ -1655,6 +1655,8 @@
 	bdi_destroy(&fs_info->bdi);
 #endif
 	kfree(fs_info);
+	kfree(chunk_root);
+	kfree(dev_root);
 	return ERR_PTR(err);
 }