mirror of
https://github.com/sheumann/hush.git
synced 2024-12-21 23:29:34 +00:00
cp: revert a recent buggy change, and add a comment why it's wrong
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
d427689eee
commit
d5fddcd57f
@ -182,10 +182,12 @@ int cp_main(int argc, char **argv)
|
|||||||
if (copy_file(*argv, dest, flags) < 0) {
|
if (copy_file(*argv, dest, flags) < 0) {
|
||||||
status = EXIT_FAILURE;
|
status = EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
free((void*)dest);
|
|
||||||
if (*++argv == last) {
|
if (*++argv == last) {
|
||||||
|
/* possibly leaking dest... */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
/* don't move up: dest may be == last and not malloced! */
|
||||||
|
free((void*)dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Exit. We are NOEXEC, not NOFORK. We do exit at the end of main() */
|
/* Exit. We are NOEXEC, not NOFORK. We do exit at the end of main() */
|
||||||
|
Loading…
Reference in New Issue
Block a user