summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorVincent Labrecque <vincent@cvs.openbsd.org>2004-01-15 20:55:48 +0000
committerVincent Labrecque <vincent@cvs.openbsd.org>2004-01-15 20:55:48 +0000
commitc4dd64896203bc903606bfe63de178a3daf11452 (patch)
tree75e059775009618454e30550cae9d3045236cd90 /usr.bin
parent2013ef0072d6bc9919bbf7b5dfc80727b0500553 (diff)
fix an early free that made compile-goto-error work only from time to time
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mg/grep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/mg/grep.c b/usr.bin/mg/grep.c
index e51a39faa65..9223eb033b6 100644
--- a/usr.bin/mg/grep.c
+++ b/usr.bin/mg/grep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: grep.c,v 1.9 2003/11/09 00:16:36 vincent Exp $ */
+/* $OpenBSD: grep.c,v 1.10 2004/01/15 20:55:47 vincent Exp $ */
/*
* Copyright (c) 2001 Artur Grabowski <art@openbsd.org>. All rights reserved.
*
@@ -213,11 +213,13 @@ retry:
lineno = strtol(ln, &lp1, 10);
if (lp != lp1 + 1)
goto fail;
- free(line);
adjf = adjustname(fname);
+ free(line);
+
if (adjf == NULL)
return (FALSE);
+
if ((bp = findbuffer(adjf)) == NULL)
return FALSE;
if ((wp = popbuf(bp)) == NULL)