From 2e4d237b53f691d580df9a793dd03bf36c8e6d80 Mon Sep 17 00:00:00 2001 From: Ray Lai Date: Wed, 27 Sep 2006 06:25:47 +0000 Subject: Plug memory leak. OK niallo@. --- usr.bin/rcs/diff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.bin/rcs') diff --git a/usr.bin/rcs/diff.c b/usr.bin/rcs/diff.c index 8b837fb4ef9..b5aa4f15729 100644 --- a/usr.bin/rcs/diff.c +++ b/usr.bin/rcs/diff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff.c,v 1.9 2006/09/21 15:30:07 millert Exp $ */ +/* $OpenBSD: diff.c,v 1.10 2006/09/27 06:25:46 ray Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. * All rights reserved. @@ -863,6 +863,7 @@ preadline(int fd, size_t rlen, off_t off) line = xmalloc(rlen + 1); if ((nr = pread(fd, line, rlen, off)) < 0) { warn("preadline failed"); + xfree(line); return (NULL); } line[nr] = '\0'; -- cgit v1.2.3