Skip to contentSkip to conversation

ext4: fix memory leak when symlink decryption fails

PATCH Applied Eric Biggers 2 participants 2 messages Sep 12, 2016 – Sep 15, 2016 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ext4: fix memory leak when symlink decryption fails

This bug was introduced in v4.8-rc1.

---
 fs/ext4/symlink.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/ext4/symlink.c +1 -1
index 4d83d9e..04a7850 100644
@@ -65,13 +65,12 @@ static const char *ext4_encrypted_get_link(struct dentry *dentry,
 	res = fscrypt_fname_alloc_buffer(inode, cstr.len, &pstr);
 	if (res)
 		goto errout;
+	paddr = pstr.name;
 
 	res = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr);
 	if (res < 0)
 		goto errout;
 
-	paddr = pstr.name;