changeset 16658:c3901ac774cb

Make static analyzer happier.
author Timo Sirainen <tss@iki.fi>
date Mon, 05 Aug 2013 22:21:29 +0300
parents c41eab7d5d05
children 71f0696749ab
files src/director/user-directory.c src/lib-http/test-http-response-parser.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/director/user-directory.c	Mon Aug 05 22:16:02 2013 +0300
+++ b/src/director/user-directory.c	Mon Aug 05 22:21:29 2013 +0300
@@ -243,7 +243,8 @@
 	dir->head = dir->tail = NULL;
 	array_foreach(&users, userp)
 		DLLIST2_APPEND(&dir->head, &dir->tail, *userp);
-	i_assert(dir->head->timestamp <= dir->tail->timestamp);
+	i_assert(dir->head != NULL &&
+		 dir->head->timestamp <= dir->tail->timestamp);
 	array_free(&users);
 }
 
--- a/src/lib-http/test-http-response-parser.c	Mon Aug 05 22:16:02 2013 +0300
+++ b/src/lib-http/test-http-response-parser.c	Mon Aug 05 22:21:29 2013 +0300
@@ -136,6 +136,7 @@
 		
 		if (ret == 0) {
 			/* verify last response only */
+			i_assert(response != NULL);
 			test_out(t_strdup_printf("response->status = %d",test->status),
 					response->status == test->status);
 			if (payload == NULL || test->payload == NULL) {