projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix a memory leak if parent directory creation failed.
[oweals/busybox.git]
/
libbb
/
print_file.c
diff --git
a/libbb/print_file.c
b/libbb/print_file.c
index b477234548177956c77bdff08d44944c81797671..bfedc5eff6167451c0bd5972112c11dd62ba0faa 100644
(file)
--- a/
libbb/print_file.c
+++ b/
libbb/print_file.c
@@
-26,12
+26,9
@@
extern void print_file(FILE *file)
{
- int c;
-
- while ((c = getc(file)) != EOF)
- putc(c, stdout);
- fclose(file);
fflush(stdout);
+ copyfd(fileno(file), fileno(stdout));
+ fclose(file);
}
extern int print_file_by_name(char *filename)