summaryrefslogtreecommitdiff
path: root/libpurple/prefs.c
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2023-03-23 22:03:45 -0500
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2023-03-23 22:03:45 -0500
commitddbb62d46470ba81a3cd2ec91febe6d11e3f34e0 (patch)
treee2169f7c89e68fc2e403803f9ce7d3d619a56620 /libpurple/prefs.c
parent16071bc64088b65c889ddbc993f8f52cecace8ed (diff)
downloadpidgin-ddbb62d46470ba81a3cd2ec91febe6d11e3f34e0.tar.gz
Fix leaked errors
And also simplify some cases with `g_clear_error`. Testing Done: Compiled and ran tests in valgrind, though it never noticed these anyway. Reviewed at https://reviews.imfreedom.org/r/2384/
Diffstat (limited to 'libpurple/prefs.c')
-rw-r--r--libpurple/prefs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libpurple/prefs.c b/libpurple/prefs.c
index 268cefc9b3..9c0816d139 100644
--- a/libpurple/prefs.c
+++ b/libpurple/prefs.c
@@ -410,9 +410,7 @@ purple_prefs_load(void)
if(!g_file_get_contents(filename, &contents, &length, &error)) {
const gchar *sysconfdir = PURPLE_SYSCONFDIR;
g_free(filename);
- g_error_free(error);
-
- error = NULL;
+ g_clear_error(&error);
if (sysconfdir == NULL)
sysconfdir = "";