Index: uspace/lib/c/generic/uuid.c
===================================================================
--- uspace/lib/c/generic/uuid.c	(revision a4ee8b3fca0d7b0c543ce931781458b39631b265)
+++ uspace/lib/c/generic/uuid.c	(revision 221daa5dc253f7938c88334377cda6c9fde54ed2)
@@ -189,6 +189,8 @@
 	int ret = snprintf(str, size, format, uuid->b[0], uuid->b[1], uuid->b[2], uuid->b[3], uuid->b[4], uuid->b[5], uuid->b[6], uuid->b[7], uuid->b[8], uuid->b[9], uuid->b[10], uuid->b[11], uuid->b[12], uuid->b[13], uuid->b[14], uuid->b[15]);
 
-	if (ret != 36)
-		return EINVAL;
+	if (ret != 36) {
+		free(str);
+		return EINVAL;
+	}
 
 	*rstr = str;
