Module Name:    src
Committed By:   tnozaki
Date:           Sat Nov 19 18:48:39 UTC 2011

Modified Files:
        src/lib/libc/citrus/modules: citrus_mapper_std.c

Log Message:
fix memory leak, pointed by nonaka-san(again^3).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/lib/libc/citrus/modules/citrus_mapper_std.c

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

Modified files:

Index: src/lib/libc/citrus/modules/citrus_mapper_std.c
diff -u src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9 src/lib/libc/citrus/modules/citrus_mapper_std.c:1.10
--- src/lib/libc/citrus/modules/citrus_mapper_std.c:1.9	Sun Oct 30 21:48:27 2011
+++ src/lib/libc/citrus/modules/citrus_mapper_std.c	Sat Nov 19 18:48:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $	*/
+/*	$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $	*/
 
 /*-
  * Copyright (c)2003, 2006 Citrus Project,
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_mapper_std.c,v 1.9 2011/10/30 21:48:27 wiz Exp $");
+__RCSID("$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include <assert.h>
@@ -185,8 +185,11 @@ rowcol_parse_variable_compat(struct _cit
 	n = be32toh(rcx->rcx_src_row_end);
 	if (m + n > 0) {
 		ret = set_linear_zone(lz, m, n);
-		if (ret != 0)
+		if (ret != 0) {
+			free(rc->rc_src_rowcol);
+			rc->rc_src_rowcol = NULL;
 			return ret;
+		}
 		++rc->rc_src_rowcol_len, ++lz;
 	}
 	m = be32toh(rcx->rcx_src_col_begin);

Reply via email to