[libgdata] core: Don't use deallocated memory
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] core: Don't use deallocated memory
- Date: Thu, 30 Dec 2010 15:37:40 +0000 (UTC)
commit 4869dd85d3853184a42fe66ceded941dfbd148b3
Author: Philip Withnall <philip tecnocode co uk>
Date: Thu Dec 30 14:54:04 2010 +0000
core: Don't use deallocated memory
When authenticating asynchronously, don't attempt to use the username and
password from the asynchronous closure after it's been implicitly deallocated
by changing the result value of the GSimpleAsyncResult.
See: bgo#635736
gdata/gdata-service.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/gdata/gdata-service.c b/gdata/gdata-service.c
index e386127..dec5ec9 100644
--- a/gdata/gdata-service.c
+++ b/gdata/gdata-service.c
@@ -814,15 +814,13 @@ authenticate_thread (GSimpleAsyncResult *result, GDataService *service, GCancell
/* Authenticate and return */
success = authenticate (service, data->username, data->password, NULL, NULL, cancellable, &error);
+ set_authentication_details (service, data->username, data->password, success);
g_simple_async_result_set_op_res_gboolean (result, success);
if (success == FALSE) {
g_simple_async_result_set_from_error (result, error);
g_error_free (error);
}
-
- /* Update the authentication details held by the service (protected by a mutex) */
- set_authentication_details (service, data->username, data->password, success);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]