Commit 1846ed70 authored by Andrew Price's avatar Andrew Price
Browse files

Restore perms after failing to download remote mwrc files

parent 45233543
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ static FILE *OpenInitFile(const char *base, const char *filename)
		file = tmpfile();
		if (file == NULL) {
			fprintf(stderr, "Error opening temporary file\n");
			perms_restore();
			return NULL;
		}
		cl = curl_easy_init();
@@ -73,6 +74,7 @@ static FILE *OpenInitFile(const char *base, const char *filename)
		if (curl_easy_perform(cl)) {
			fprintf(stderr, "Error loading %s: %s\n", filename, cerr);
			fclose(file);
			perms_restore();
			return NULL;
		}
		curl_easy_cleanup(cl);