mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-12-01 21:19:16 -06:00
Protect against nullptr dereference, remove unused GError.
Found by clang static analyzer.
This commit is contained in:
parent
24ce92056d
commit
876bfd19ad
@ -1539,7 +1539,6 @@ try_gz_open (const char* filename, const char* perms, gboolean use_gzip,
|
||||
{
|
||||
int filedes[2];
|
||||
GThread* thread;
|
||||
GError* error = NULL;
|
||||
gz_thread_params_t* params;
|
||||
FILE* file;
|
||||
|
||||
@ -1564,9 +1563,7 @@ try_gz_open (const char* filename, const char* perms, gboolean use_gzip,
|
||||
params);
|
||||
if (!thread)
|
||||
{
|
||||
g_warning ("Could not create thread for (de)compression: %s",
|
||||
error->message);
|
||||
g_error_free (error);
|
||||
g_warning ("Could not create thread for (de)compression.");
|
||||
g_free (params->filename);
|
||||
g_free (params->perms);
|
||||
g_free (params);
|
||||
|
@ -65,6 +65,8 @@ write_one_account (FILE* out,
|
||||
xmlElemDump (out, NULL, accnode);
|
||||
xmlFreeNode (accnode);
|
||||
|
||||
g_return_val_if_fail(gd, FALSE);
|
||||
|
||||
if (ferror (out) || fprintf (out, "\n") < 0)
|
||||
return FALSE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user