dovecot-2.2-pigeonhole: lib-sieve: sieve-error.c: Made static an...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Mon May 12 18:40:48 UTC 2014


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/f5fa3549de0d
changeset: 1859:f5fa3549de0d
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Mon May 12 20:40:39 2014 +0200
description:
lib-sieve: sieve-error.c: Made static analyzer happier.

diffstat:

 src/lib-sieve/sieve-error.c |  30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diffs (65 lines):

diff -r 5b41f1bca5ca -r f5fa3549de0d src/lib-sieve/sieve-error.c
--- a/src/lib-sieve/sieve-error.c	Mon May 12 20:22:30 2014 +0200
+++ b/src/lib-sieve/sieve-error.c	Mon May 12 20:40:39 2014 +0200
@@ -78,6 +78,7 @@
 {
 	if ( (flags & SIEVE_ERROR_FLAG_GLOBAL) != 0 &&
 		(ehandler == NULL || ehandler->parent == NULL)) {
+		i_assert(svinst->system_ehandler != NULL);
 		if (svinst->system_ehandler != ehandler ||
 			(flags & SIEVE_ERROR_FLAG_GLOBAL_MAX_INFO) != 0) {
 			va_list args_copy;
@@ -118,6 +119,7 @@
 {
 	if ( (flags & SIEVE_ERROR_FLAG_GLOBAL) != 0 &&
 		(ehandler == NULL || ehandler->parent == NULL)) {
+		i_assert(svinst->system_ehandler != NULL);
 		if (svinst->system_ehandler != ehandler ||
 			(flags & SIEVE_ERROR_FLAG_GLOBAL_MAX_INFO) != 0) {
 			va_list args_copy;
@@ -156,14 +158,16 @@
 {
 	if ( (flags & SIEVE_ERROR_FLAG_GLOBAL) != 0 &&
 		(ehandler == NULL || ehandler->parent == NULL) &&
-		svinst->system_ehandler != ehandler &&
-		svinst->system_ehandler->vinfo != NULL ) {
-		va_list args_copy;
+		svinst->system_ehandler != ehandler) {
+		i_assert(svinst->system_ehandler != NULL);
+		if (svinst->system_ehandler->vinfo != NULL ) {
+			va_list args_copy;
 
-		VA_COPY(args_copy, args);
+			VA_COPY(args_copy, args);
 
-		svinst->system_ehandler->vinfo
-			(svinst->system_ehandler, 0, location, fmt, args_copy);
+			svinst->system_ehandler->vinfo
+				(svinst->system_ehandler, 0, location, fmt, args_copy);
+		}
 	}
 
 	if ( ehandler == NULL )
@@ -181,14 +185,16 @@
 {
 	if ( (flags & SIEVE_ERROR_FLAG_GLOBAL) != 0 &&
 		(ehandler == NULL || ehandler->parent == NULL) &&
-		svinst->system_ehandler != ehandler &&
-		svinst->system_ehandler->vdebug != NULL ) {
-		va_list args_copy;
+		svinst->system_ehandler != ehandler) {
+		i_assert(svinst->system_ehandler != NULL);
+		if (svinst->system_ehandler->vdebug != NULL ) {
+			va_list args_copy;
 
-		VA_COPY(args_copy, args);
+			VA_COPY(args_copy, args);
 
-		svinst->system_ehandler->vdebug
-			(svinst->system_ehandler, 0, location, fmt, args_copy);
+			svinst->system_ehandler->vdebug
+				(svinst->system_ehandler, 0, location, fmt, args_copy);
+		}
 	}
 
 	if ( ehandler == NULL )


More information about the dovecot-cvs mailing list