[Xfce4-commits] <xfce4-screenshooter:master> Fix a crash due to uninitialized GError.
Jérôme Guelfucci
noreply at xfce.org
Sun Oct 11 18:36:01 CEST 2009
Updating branch refs/heads/master
to a846ab7c026cd7befe4349f9bc4f47f6cf752483 (commit)
from 172a73a3751cb7a3c9ce87bfc9ac6a0ad8a4809e (commit)
commit a846ab7c026cd7befe4349f9bc4f47f6cf752483
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date: Sun Oct 11 18:36:30 2009 +0200
Fix a crash due to uninitialized GError.
Only free the last user when it was set.
lib/screenshooter-zimagez.c | 4 +++-
src/main.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/screenshooter-zimagez.c b/lib/screenshooter-zimagez.c
index cca0858..581b284 100644
--- a/lib/screenshooter-zimagez.c
+++ b/lib/screenshooter-zimagez.c
@@ -116,6 +116,8 @@ do_xmlrpc (SoupSession *session, const gchar *uri, const gchar *method,
GError *err = NULL;
char *body;
+ g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
va_start (args, retval);
params = soup_value_array_from_args (args);
va_end (args);
@@ -243,7 +245,7 @@ zimagez_upload_job (ScreenshooterJob *job, GValueArray *param_values, GError **e
SoupSession *session;
SoupURI *soup_proxy_uri;
- GError *tmp_error;
+ GError *tmp_error = NULL;
GtkTreeIter iter;
GtkListStore *liststore;
GValue response_value;
diff --git a/src/main.c b/src/main.c
index 536157e..4a9daeb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -306,7 +306,8 @@ int main (int argc, char **argv)
g_free (sd->screenshot_dir);
g_free (sd->title);
g_free (sd->app);
- g_free (sd->last_user);
+ if (sd->last_user)
+ g_free (sd->last_user);
g_free (sd);
TRACE ("Ciao");
More information about the Xfce4-commits
mailing list