Skip to contentSkip to conversation

erofs-utils: fix a memory leak of compressmeta

PATCH In review Gao Xiang via Linux-erofs 2 participants 2 messages Aug 25, 2019 – Aug 26, 2019 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 erofs-utils: fix a memory leak of compressmeta

compressmeta should be freed after successfully written.

---
 lib/inode.c | 1 +
 1 file changed, 1 insertion(+)
lib/inode.c +1 -0
index 581f263..141a300 100644
@@ -404,6 +404,7 @@ static bool erofs_bh_flush_write_inode(struct erofs_buffer_head *bh)
 		ret = dev_write(inode->compressmeta, off, inode->extent_isize);
 		if (ret)
 			return false;
+		free(inode->compressmeta);
 	}
 
 	inode->bh = NULL;
Signature · 1 line
2.17.1