"FROM account "
"WHERE email_addr = ?",
-1, SQLITE_PREPARE_PERSISTENT, &AccountGetStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(AccountGetStmt, 1, norm_addr->mailbox, -1, SQLITE_STATIC) != SQLITE_OK)
"enabled) "
"VALUES (?, ?, ?, ?, ?);",
-1, SQLITE_PREPARE_PERSISTENT, &AccountInsertStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(AccountInsertStmt, 1, norm_addr->mailbox, -1, SQLITE_STATIC) != SQLITE_OK)
"enabled = ? "
"WHERE email_addr = ?;",
-1, SQLITE_PREPARE_PERSISTENT, &AccountUpdateStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(AccountUpdateStmt, 1, acct->keyid, -1, SQLITE_STATIC) != SQLITE_OK)
"DELETE from account "
"WHERE email_addr = ?;",
-1, SQLITE_PREPARE_PERSISTENT, &AccountDeleteStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(AccountDeleteStmt, 1, acct->email_addr, -1, SQLITE_STATIC) != SQLITE_OK)
"FROM account "
"ORDER BY email_addr",
-1, &stmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
while ((result = sqlite3_step(stmt)) == SQLITE_ROW)
{
"FROM peer "
"WHERE email_addr = ?",
-1, SQLITE_PREPARE_PERSISTENT, &PeerGetStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(PeerGetStmt, 1, norm_addr->mailbox, -1, SQLITE_STATIC) != SQLITE_OK)
"gossip_keydata) "
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?);",
-1, SQLITE_PREPARE_PERSISTENT, &PeerInsertStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(PeerInsertStmt, 1, norm_addr->mailbox, -1, SQLITE_STATIC) != SQLITE_OK)
"gossip_keydata = ? "
"WHERE email_addr = ?;",
-1, SQLITE_PREPARE_PERSISTENT, &PeerUpdateStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_int64(PeerUpdateStmt, 1, peer->last_seen) != SQLITE_OK)
"VALUES (?, ?, ?, ?);",
-1, SQLITE_PREPARE_PERSISTENT,
&PeerHistoryInsertStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(PeerHistoryInsertStmt, 1, norm_addr->mailbox, -1, SQLITE_STATIC) != SQLITE_OK)
"VALUES (?, ?, ?, ?, ?);",
-1, SQLITE_PREPARE_PERSISTENT,
&GossipHistoryInsertStmt, NULL) != SQLITE_OK)
+ {
goto cleanup;
+ }
}
if (sqlite3_bind_text(GossipHistoryInsertStmt, 1, norm_addr->mailbox, -1,
SQLITE_STATIC) != SQLITE_OK)
+ {
goto cleanup;
+ }
if (sqlite3_bind_text(GossipHistoryInsertStmt, 2, gossip_hist->sender_email_addr,
-1, SQLITE_STATIC) != SQLITE_OK)
+ {
if (sqlite3_bind_text(GossipHistoryInsertStmt, 3, gossip_hist->email_msgid,
-1, SQLITE_STATIC) != SQLITE_OK)
+ {
goto cleanup;
+ }
+ }
if (sqlite3_bind_int64(GossipHistoryInsertStmt, 4, gossip_hist->timestamp) != SQLITE_OK)
goto cleanup;
if (sqlite3_bind_text(GossipHistoryInsertStmt, 5, gossip_hist->gossip_keydata,
-1, SQLITE_STATIC) != SQLITE_OK)
+ {
goto cleanup;
+ }
if (sqlite3_step(GossipHistoryInsertStmt) != SQLITE_DONE)
goto cleanup;