There are a number of options: most require the water shut off and the water drained from the copper pipe.
A physical repair clamp that is installed over the leaky area. Pay a visit to a hardware store or plumbing supply. This really should be looked at as a temporary fix.
A variety of materials, many epoxy based, may be put on the leaky area after the water is off and the pipe is drained, and the exterior pipe surface is cleaned up well to removed grime, dust bunnies, and corrosion. These are also available in the plumbing section of a hardware store
Patch the pipe with a coupler. If you need to repair a leak quickly and properly but you don’t have any additional pipe on hand – just a coupler and solder, that’ll do just fine. Cut the pipe over the pinhole leak so the pipe splits in two. Sand the edge, and clean the edge. Apply your flux to both ends of the pipe and attach the coupler – then hit it with your torch and apply solder. This repair isn’t as good as replacing the pipe – but it’s the next best thing.
With a single pinhole, there’s very likely others that will be coming, Copper pipe is very easy to replace with some basic soldering skills, nevertheless call a plumber if in doubt. I would take out the defective area and inspect the inside carefully to establish the level of the corrosion and how much should be replaced.Tags: pinhole leak