Index: uspace/app/edit/sheet.c
===================================================================
--- uspace/app/edit/sheet.c	(revision 2a09dcb306884fcb1ded541284a93d92e6da3853)
+++ uspace/app/edit/sheet.c	(revision 14a014f216f3cb36418a95d532172cb779c1dc7c)
@@ -79,6 +79,8 @@
 
 	sh->data = malloc(sh->dbuf_size);
-	if (sh->data == NULL)
+	if (sh->data == NULL) {
+		free(sh);
 		return ENOMEM;
+	}
 
 	list_initialize(&sh->tags);
