Skip to contentSkip to conversation

ocfs2: free vol_lable in ocfs2_delete_osb

PATCH New Joseph Qi 1 participant 1 message Sep 11, 2014 OCFS2

lore
Share & tools
lore

Joseph Qi

author
#0 lore raw

PATCH 1/1 ocfs2: free vol_lable in ocfs2_delete_osb

osb->vol_label is malloced in ocfs2_initialize_super but not freed if error occurs or during umount, thus lead to memory leak.

---
 fs/ocfs2/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/ocfs2/super.c +1 -0
index c7a89ce..9197e6a 100644
@@ -2536,6 +2536,7 @@ static void ocfs2_delete_osb(struct ocfs2_super *osb)
 	kfree(osb->journal);
 	kfree(osb->local_alloc_copy);
 	kfree(osb->uuid_str);
+	kfree(osb->vol_label);
 	ocfs2_put_dlm_debug(osb->osb_dlm_debug);
 	memset(osb, 0, sizeof(struct ocfs2_super));
 }
Signature · 1 line
1.8.4.3