[Toybox] [PATCH] cp: fix -D (--parents)

Rob Landley rob at landley.net
Fri Mar 6 16:19:46 PST 2020


On 3/4/20 12:51 PM, Jarno Mäkipää wrote:
> I know you are busy and backlog grows, but friendly reminder that this
> patch is still here.

Sorry.

You add two allocations (strdup and xmprintf()) but no corresponding free. It's
not in cp_node(), so it's not leaking per file copied, but it _is_ leaking per
file listed on the command line, which is probably ok but I'm less comfortable
with it these days than I used to be.

Mostly, I want to get it clear in my head why it needs to copy it _twice_, so I
have a window open for it, but my head is full of shell corner cases right now
and I'm making "melt through this glacier to the other side" style progress.

Rob

P.S. There was a Doctor Who episode about making that kind of progress a couple
years back, and if you google for "doctor who hugo" and then click on the 2016
entry, Google pulls up a page with the exact same summary information at the top
that does an endless loop as you click on the same entry over and over. Which I
suppose is apropos for the episode.



More information about the Toybox mailing list