Plug more memory leaks

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@20004 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Phil Longstaff
2010-12-30 15:54:06 +00:00
parent a183a07906
commit 613038acab
2 changed files with 9 additions and 7 deletions
+7 -7
View File
@@ -620,16 +620,16 @@ gnc_dbi_unlock( QofBackend *qbe )
PWARN("No lock table in database, so not unlocking it.");
return;
}
dbi_result_free( result );
if ( ( result = dbi_conn_query( dcon, "BEGIN" )) )
result = dbi_conn_query( dcon, "BEGIN" );
if ( result )
{
/* Delete the entry if it's our hostname and PID */
gchar hostname[ GNC_HOST_NAME_MAX + 1 ];
if (result)
{
dbi_result_free( result );
result = NULL;
}
dbi_result_free( result );
result = NULL;
memset( hostname, 0, sizeof(hostname) );
gethostname( hostname, GNC_HOST_NAME_MAX );
result = dbi_conn_queryf( dcon, "SELECT * FROM %s WHERE Hostname = '%s' AND PID = '%d'", lock_table, hostname, (int)GETPID() );
@@ -653,7 +653,7 @@ gnc_dbi_unlock( QofBackend *qbe )
}
return;
}
if (result)
else
{
dbi_result_free( result );
result = NULL;
+2
View File
@@ -264,6 +264,7 @@ load_all_accounts( GncSqlBackend* be )
gnc_account_append_child( pParent, s->pAccount );
next_elem = g_list_next( elem );
l_accounts_needing_parents = g_list_delete_link( l_accounts_needing_parents, elem );
g_free( s );
elem = next_elem;
progress_made = TRUE;
}
@@ -285,6 +286,7 @@ load_all_accounts( GncSqlBackend* be )
{
gnc_account_append_child( root, s->pAccount );
}
g_free( s );
l_accounts_needing_parents = g_list_delete_link( l_accounts_needing_parents, l_accounts_needing_parents );
}
}