We present a practical approach to fix memory-leak errors detected by static analyzers for C programs. Given a program and an error report that specifies memory-leak errors, we generate patches that fix the given error. To make our approach practical, we support the following features: conditional deallocation, safety, and scalability. Our technique supports insertion of conditional deallocation statements which is crucial to achieve high repairability for memory-leak. Moreover, we guarantee that our patches do not introduce new errors such as double-free and use-after-free. To this end, we statically compute life-cycle of allocated heaps through a sound and path-sensitive heap analysis and then synthesize patches that meet a safety constraint. For scalability, we designed two heuristics: a slicing heuristic and a state-merging heuristic. The former is for programs that compute a relevant program to the given error, and the latter is to compute a set of path conditions that are required for patch generation. We implemented our technique in a tool and evaluated it on open source C projects collected from GitHub. The results show that our approach is promising; it fixed 71 errors out of 95 true memory-leak errors detected by a practical static analyzer.