From 3ab899f41cda31ab763da9e73e95981dcf3d5b7f Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 18 Jun 2009 12:38:55 +0000 Subject: 2009-06-18 Marcus Brinkmann * context.h (CTX_OP_DATA_MAGIC): New macro. (struct ctx_op_data): New member MAGIC. * op-support.c (_gpgme_op_data_lookup): Initialize magic. * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic. --- src/context.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/context.h') diff --git a/src/context.h b/src/context.h index 63af1d10..e98e7bea 100644 --- a/src/context.h +++ b/src/context.h @@ -42,8 +42,14 @@ typedef enum } ctx_op_data_id_t; +/* "gpgmeres" in ASCII. */ +#define CTX_OP_DATA_MAGIC 0x736572656d677067ULL struct ctx_op_data { + /* A magic word just to make sure people don't deallocate something + that ain't a result structure. */ + unsigned long long magic; + /* The next element in the linked list, or NULL if this is the last element. Used by op data structures linked into a context. */ struct ctx_op_data *next; -- cgit v1.2.3