forked from cory/tildefriends
Use a custom allocator for everything.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3892 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include "ssb.db.h"
|
||||
|
||||
#include "mem.h"
|
||||
#include "ssb.h"
|
||||
#include "trace.h"
|
||||
|
||||
@ -248,7 +249,7 @@ bool tf_ssb_db_message_content_get(tf_ssb_t* ssb, const char* id, uint8_t** out_
|
||||
int size = sqlite3_column_bytes(statement, 0);
|
||||
if (out_blob)
|
||||
{
|
||||
*out_blob = malloc(size + 1);
|
||||
*out_blob = tf_malloc(size + 1);
|
||||
memcpy(*out_blob, blob, size);
|
||||
(*out_blob)[size] = '\0';
|
||||
}
|
||||
@ -277,7 +278,7 @@ bool tf_ssb_db_blob_get(tf_ssb_t* ssb, const char* id, uint8_t** out_blob, size_
|
||||
int size = sqlite3_column_bytes(statement, 0);
|
||||
if (out_blob)
|
||||
{
|
||||
*out_blob = malloc(size + 1);
|
||||
*out_blob = tf_malloc(size + 1);
|
||||
if (size)
|
||||
{
|
||||
memcpy(*out_blob, blob, size);
|
||||
@ -376,7 +377,7 @@ bool tf_ssb_db_get_message_by_author_and_sequence(tf_ssb_t* ssb, const char* aut
|
||||
}
|
||||
if (out_content)
|
||||
{
|
||||
*out_content = strdup((const char*)sqlite3_column_text(statement, 2));
|
||||
*out_content = tf_strdup((const char*)sqlite3_column_text(statement, 2));
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user