gnome-keyring r1138 - in trunk: . pk
- From: nnielsen svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-keyring r1138 - in trunk: . pk
- Date: Tue, 29 Apr 2008 14:26:21 +0100 (BST)
Author: nnielsen
Date: Tue Apr 29 13:26:21 2008
New Revision: 1138
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1138&view=rev
Log:
* pk/gkr-pk-object-storage.c: Return gboolean from parsed_*
callbacks so we don't have double free scenarios.
Modified:
trunk/ChangeLog
trunk/pk/gkr-pk-object-storage.c
Modified: trunk/pk/gkr-pk-object-storage.c
==============================================================================
--- trunk/pk/gkr-pk-object-storage.c (original)
+++ trunk/pk/gkr-pk-object-storage.c Tue Apr 29 13:26:21 2008
@@ -428,7 +428,7 @@
return object;
}
-static void
+static gboolean
parser_parsed_partial (GkrPkixParser *parser, GQuark location, gkrid digest,
GQuark type, ParseContext *ctx)
{
@@ -446,7 +446,7 @@
if (type) {
object = prepare_object (ctx->storage, location, digest, type);
- g_return_if_fail (object != NULL);
+ g_return_val_if_fail (object != NULL, FALSE);
/* Make note of having seen this object in load requests */
g_hash_table_remove (pv->specific_load_requests, digest);
@@ -458,19 +458,21 @@
/* Track the type of this digest */
g_hash_table_insert (ctx->types_by_digest, gkr_id_dup (digest),
GUINT_TO_POINTER (type));
+
+ return TRUE;
}
-static void
+static gboolean
parser_parsed_sexp (GkrPkixParser *parser, GQuark location, gkrid digest,
GQuark type, gcry_sexp_t sexp, ParseContext *ctx)
{
GkrPkObjectStoragePrivate *pv = GKR_PK_OBJECT_STORAGE_GET_PRIVATE (ctx->storage);
GkrPkObject *object;
- g_return_if_fail (type != 0);
+ g_return_val_if_fail (type != 0, FALSE);
object = prepare_object (ctx->storage, location, digest, type);
- g_return_if_fail (object != NULL);
+ g_return_val_if_fail (object != NULL, FALSE);
/* Make note of having seen this object in load requests */
g_hash_table_remove (pv->specific_load_requests, digest);
@@ -493,19 +495,21 @@
*/
if (!gkr_pk_index_get_boolean (object, "imported", FALSE))
gkr_pk_object_import (object);
+
+ return TRUE;
}
-static void
+static gboolean
parser_parsed_asn1 (GkrPkixParser *parser, GQuark location, gkrconstid digest,
GQuark type, ASN1_TYPE asn1, ParseContext *ctx)
{
GkrPkObjectStoragePrivate *pv = GKR_PK_OBJECT_STORAGE_GET_PRIVATE (ctx->storage);
GkrPkObject *object;
- g_return_if_fail (type != 0);
+ g_return_val_if_fail (type != 0, FALSE);
object = prepare_object (ctx->storage, location, digest, type);
- g_return_if_fail (object != NULL);
+ g_return_val_if_fail (object != NULL, FALSE);
/* Make note of having seen this object in load requests */
g_hash_table_remove (pv->specific_load_requests, digest);
@@ -528,6 +532,8 @@
*/
if (gkr_pk_index_get_boolean (object, "imported", FALSE))
gkr_pk_object_import (object);
+
+ return TRUE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]