Module Name:    src
Committed By:   msaitoh
Date:           Fri Dec 14 08:16:51 UTC 2012

Modified Files:
        src/usr.bin/sed: compile.c

Log Message:
Fix memory leak.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/sed/compile.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/sed/compile.c
diff -u src/usr.bin/sed/compile.c:1.37 src/usr.bin/sed/compile.c:1.38
--- src/usr.bin/sed/compile.c:1.37	Fri Feb 19 16:35:27 2010
+++ src/usr.bin/sed/compile.c	Fri Dec 14 08:16:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: compile.c,v 1.37 2010/02/19 16:35:27 tnn Exp $	*/
+/*	$NetBSD: compile.c,v 1.38 2012/12/14 08:16:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -76,7 +76,7 @@
 #if 0
 static char sccsid[] = "@(#)compile.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: compile.c,v 1.37 2010/02/19 16:35:27 tnn Exp $");
+__RCSID("$NetBSD: compile.c,v 1.38 2012/12/14 08:16:51 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -474,6 +474,7 @@ compile_re(char *p, regex_t **repp)
 		err(COMPILE, "RE error: %s", strregerror(eval, *repp));
 	if (maxnsub < (*repp)->re_nsub)
 		maxnsub = (*repp)->re_nsub;
+	free(re);
 	return (p);
 }
 

Reply via email to