]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-sql: Add assert to sql_result_more_s()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 19 Jul 2017 07:35:43 +0000 (10:35 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 19 Jul 2017 09:45:33 +0000 (12:45 +0300)
Should avoid a warning from static analyzer.

src/lib-sql/sql-api.c

index 705e5667640c95606e7dc19e12dc073ca1646756..3cee9ce7d751d533f21a0b354e1970d1984b3494 100644 (file)
@@ -300,6 +300,8 @@ void sql_result_more_s(struct sql_result **result)
        i_assert((*result)->v.more != NULL);
 
        (*result)->v.more(result, FALSE, sql_result_more_sync_callback, result);
+       /* the callback must have been called */
+       i_assert(*result != NULL);
 }
 
 unsigned int sql_result_get_fields_count(struct sql_result *result)