From aa67bcab358d297b9cc615d4fb833a6c5668a44c Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Sun, 18 Jun 2006 20:41:25 +0000 Subject: Fix memleak; From Coverity Scan, CID 3135. From simonb NetBSD ok naddy@, otto@ --- usr.bin/vi/common/exf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c index 64fe61249a5..29f78837b40 100644 --- a/usr.bin/vi/common/exf.c +++ b/usr.bin/vi/common/exf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exf.c,v 1.22 2006/01/08 21:05:39 miod Exp $ */ +/* $OpenBSD: exf.c,v 1.23 2006/06/18 20:41:24 jasper Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -174,8 +174,10 @@ file_init(sp, frp, rcv_name, flags) * Scan the user's path to find the file that we're going to * try and open. */ - if (file_spath(sp, frp, &sb, &exists)) + if (file_spath(sp, frp, &sb, &exists)) { + free(ep); return (1); + } /* * If no name or backing file, for whatever reason, create a backing -- cgit v1.2.3