fix a couple of obvious bugs

This commit is contained in:
Eric House 2017-11-10 20:30:25 -08:00
parent d1e6a0d1d3
commit ecc247d56d
2 changed files with 4 additions and 3 deletions

View file

@ -129,13 +129,14 @@ writeBlobColumnData( const XP_U8* data, gsize len, XP_U16 strVersion, sqlite3* p
assertPrintResult( pDb, result, SQLITE_OK );
result = sqlite3_blob_close( blob );
assertPrintResult( pDb, result, SQLITE_OK );
if ( !!stmt ) {
sqlite3_finalize( stmt );
}
LOG_RETURNF( "%lld", curRow );
return curRow;
}
} /* writeBlobColumnData */
static sqlite3_int64
writeBlobColumnStream( XWStreamCtxt* stream, sqlite3* pDb, sqlite3_int64 curRow,
@ -326,7 +327,7 @@ getRelayIDsToRowsMap( sqlite3* pDb )
XP_UCHAR relayID[32];
getColumnText( ppStmt, 0, relayID, VSIZE(relayID) );
gpointer key = g_strdup( relayID );
sqlite3_int64* value = g_malloc( sizeof( *key ) );
sqlite3_int64* value = g_malloc( sizeof( value ) );
*value = sqlite3_column_int64( ppStmt, 1 );
g_hash_table_insert( table, key, value );
/* XP_LOGF( "%s(): added map %s => %lld", __func__, (char*)key, *value ); */

View file

@ -152,7 +152,7 @@ addJsonParams( CURL* curl, va_list ap )
json_object* param = va_arg(ap, json_object*);
XP_ASSERT( !!param );
const char* asStr = json_object_to_json_string( param );
const char* asStr = json_object_get_string( param );
XP_LOGF( "%s: adding param (with name %s): %s", __func__, name, asStr );
char* curl_params = curl_easy_escape( curl, asStr, strlen(asStr) );