// bind
res = sqlite3_bind_int(m_stmt, 1, userId);
- TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, , "sqlite3_bind_int : %d", res);
+ TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, m_dbMutex.unlock(), "sqlite3_bind_int : %d", res);
res = sqlite3_bind_text(m_stmt, 2, privacyId.c_str(), -1, SQLITE_TRANSIENT);
- TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, , "sqlite3_bind_text : %d", res);
+ TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, m_dbMutex.unlock(), "sqlite3_bind_text : %d", res);
res = sqlite3_bind_int(m_stmt, 3, startDate);
- TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, , "sqlite3_bind_int : %d", res);
+ TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, m_dbMutex.unlock(), "sqlite3_bind_int : %d", res);
res = sqlite3_bind_int(m_stmt, 4, endDate);
- TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, , "sqlite3_bind_int : %d", res);
+ TryReturn(res == SQLITE_OK, PRIV_GUARD_ERROR_DB_ERROR, m_dbMutex.unlock(), "sqlite3_bind_int : %d", res);
while ((res = sqlite3_step(m_stmt)) == SQLITE_ROW) {
const char* packageId = reinterpret_cast < const char* > (sqlite3_column_text(m_stmt, 0));
if (new_packet_to_send != NULL) {
pg_strlcpy(new_packet_to_send, packet_to_send, strlen(packet_to_send));
strncat(new_packet_to_send, packet_to_send, sizeof(new_packet_to_send) - strlen(new_packet_to_send) - 1);
+ free(packet_to_send);
packet_to_send = strdup(new_packet_to_send);
free(new_packet_to_send);
}
if(show_clock) interval[count] = (tp_after.tv_sec - tp_before.tv_sec) * 1000000000 + tp_after.tv_nsec - tp_before.tv_nsec;
}
+ free(packet_to_send);
__finish_test();
}