dovecot-1.2-sieve: Fixed potential memory leak in generator.

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Fri May 14 13:17:31 EEST 2010


details:   http://hg.rename-it.nl/dovecot-1.2-sieve/rev/bf7636cbeba9
changeset: 1254:bf7636cbeba9
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Fri May 14 11:23:55 2010 +0200
description:
Fixed potential memory leak in generator.

diffstat:

 src/lib-sieve/sieve-generator.c |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (31 lines):

diff -r e06b823fc75f -r bf7636cbeba9 src/lib-sieve/sieve-generator.c
--- a/src/lib-sieve/sieve-generator.c	Mon May 03 20:02:39 2010 +0200
+++ b/src/lib-sieve/sieve-generator.c	Fri May 14 11:23:55 2010 +0200
@@ -427,17 +427,20 @@
 	
 		/* Load */
 		if ( ext->def != NULL && ext->def->generator_load != NULL &&
-			!ext->def->generator_load(ext, &gentr->genenv) )
-			return FALSE;
+			!ext->def->generator_load(ext, &gentr->genenv) ) {
+			result = FALSE;
+		}
 	}
 
 	/* Generate code */
 	
-	if ( !sieve_generate_block
-		(&gentr->genenv, sieve_ast_root(gentr->genenv.ast))) 
-		result = FALSE;
-	else if ( topmost ) 
-		sieve_binary_activate(*sbin);
+	if ( result ) {
+		if ( !sieve_generate_block
+			(&gentr->genenv, sieve_ast_root(gentr->genenv.ast))) 
+			result = FALSE;
+		else if ( topmost ) 
+			sieve_binary_activate(*sbin);
+	}
 
 	/* Cleanup */
 		


More information about the dovecot-cvs mailing list