History

tinylibmaker: On error situation tempfile was not removed

unknown committed 16 years ago

Commit 27bcc8f1 parent 95bc36a1 file · +3 −0Browse files

Unified · Split

win32/tools/tiny_libmaker.c+3−0
@@ -99,6 +99,7 @@ int main(int argc, char **argv) · 98 unmodified lines
9999 if ((fh = fopen(afile, "wb")) == NULL)
100100 {
101101 fprintf(stderr, "Can't open file %s \n", afile);
102+ fclose(fo);
102103 remove(tfile);
103104 return 2;
104105 }
@@ -117,6 +118,7 @@ int main(int argc, char **argv) · 12 unmodified lines
117118 if ((fi = fopen(argv[iarg], "rb")) == NULL)
118119 {
119120 fprintf(stderr, "Can't open file %s \n", argv[iarg]);
121+ fclose(fo);
120122 remove(tfile);
121123 return 2;
122124 }
@@ -133,6 +135,7 @@ int main(int argc, char **argv) · 10 unmodified lines
133135 if (ehdr->e_ident[4] != TCC_ELFCLASS)
134136 {
135137 fprintf(stderr, "Unsupported Elf Class: %s\n", argv[iarg]);
138+ fclose(fo);
136139 remove(tfile);
137140 return 2;
138141 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t