Index: uspace/app/download/main.c
===================================================================
--- uspace/app/download/main.c	(revision fc3d4fd50aa9d132c9cadad4795d9b29511d59cc)
+++ uspace/app/download/main.c	(revision 9713b0b213e041e8599c2108c67fa8c0a95be59c)
@@ -237,5 +237,5 @@
 	http_destroy(http);
 	uri_destroy(uri);
-	if (fclose(ofile) != 0) {
+	if (ofile != NULL && fclose(ofile) != 0) {
 		printf("Error writing '%s'.\n", ofname);
 		return EIO;
