Index: uspace/lib/c/generic/uuid.c
===================================================================
--- uspace/lib/c/generic/uuid.c	(revision ec506d49cc23064164b13e117ffb756c67088934)
+++ uspace/lib/c/generic/uuid.c	(revision dd4b54d38dda4091bd991bd2c577e8e8172e056f)
@@ -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;
