Module Name:    src
Committed By:   riz
Date:           Fri Nov 23 16:37:22 UTC 2012

Modified Files:
        src/sbin/init [netbsd-6]: init.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #698):
        sbin/init/init.c: revision 1.105
Add missing free() in error path.


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.102.4.1 src/sbin/init/init.c

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

Modified files:

Index: src/sbin/init/init.c
diff -u src/sbin/init/init.c:1.102 src/sbin/init/init.c:1.102.4.1
--- src/sbin/init/init.c:1.102	Sun Aug 28 10:13:03 2011
+++ src/sbin/init/init.c	Fri Nov 23 16:37:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: init.c,v 1.102 2011/08/28 10:13:03 christos Exp $	*/
+/*	$NetBSD: init.c,v 1.102.4.1 2012/11/23 16:37:21 riz Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)init.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: init.c,v 1.102 2011/08/28 10:13:03 christos Exp $");
+__RCSID("$NetBSD: init.c,v 1.102.4.1 2012/11/23 16:37:21 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -1097,8 +1097,10 @@ new_session(session_t *sprev, int sessio
 	sp->se_index = session_index;
 
 	(void)asprintf(&sp->se_device, "%s%s", _PATH_DEV, typ->ty_name);
-	if (!sp->se_device)
+	if (!sp->se_device) {
+		free(sp);
 		return NULL;
+	}
 
 	if (setupargv(sp, typ) == 0) {
 		free_session(sp);

Reply via email to