]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-sql: sql_result.free() should never be reached from the query callback.
authorTimo Sirainen <tss@iki.fi>
Wed, 2 Sep 2015 14:16:41 +0000 (17:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 2 Sep 2015 14:16:41 +0000 (17:16 +0300)
This code was probably added before sql_result refcounting.

src/lib-sql/driver-cassandra.c
src/lib-sql/driver-pgsql.c

index 415cefa5f4aeefb6044668e405f4b802a9b3dd03..78f7036f0d8d2974d8a4b27e724c78a4c4b2be27 100644 (file)
@@ -431,13 +431,7 @@ static void driver_cassandra_result_free(struct sql_result *_result)
        struct cassandra_db *db = (struct cassandra_db *)_result->db;
         struct cassandra_result *result = (struct cassandra_result *)_result;
 
-       if (result->api.callback) {
-               /* we're coming here from a user's sql_result_free() that's
-                  being called from a callback. we'll do this later,
-                  so ignore. */
-               return;
-       }
-
+       i_assert(!result->api.callback);
        i_assert(db->cur_result == result);
        i_assert(result->callback == NULL);
 
index 95fa0052be094e3b404bb331a79b7c176f083492..6044bdba283b014136a0de77120cbfbfef7d76df 100644 (file)
@@ -328,13 +328,7 @@ static void driver_pgsql_result_free(struct sql_result *_result)
         struct pgsql_result *result = (struct pgsql_result *)_result;
        bool success;
 
-       if (result->api.callback) {
-               /* we're coming here from a user's sql_result_free() that's
-                  being called from a callback. we'll do this later,
-                  so ignore. */
-               return;
-       }
-
+       i_assert(!result->api.callback);
        i_assert(db->cur_result == result);
        i_assert(result->callback == NULL);