1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

2006-12-20 Marcus Brinkmann <marcus@g10code.de>

* base64.c: Add new members READER and WRITER in union U2.
	(gpgsm_create_reader): Initialise CTX->u2.reader.
	(gpgsm_destroy_reader): Invoke ksba_reader_release.  Return early
	if CTX is NULL.
	(gpgsm_create_writer): Initialise CTX->u2.writer.
	(gpgsm_destroy_writer): Invoke ksba_writer_release.  Return early
	if CTX is NULL.
This commit is contained in:
Marcus Brinkmann 2006-12-20 22:52:14 +00:00
parent f1f975577e
commit be2c54dd94
2 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,13 @@
2006-12-20 Marcus Brinkmann <marcus@g10code.de>
* base64.c: Add new members READER and WRITER in union U2.
(gpgsm_create_reader): Initialise CTX->u2.reader.
(gpgsm_destroy_reader): Invoke ksba_reader_release. Return early
if CTX is NULL.
(gpgsm_create_writer): Initialise CTX->u2.writer.
(gpgsm_destroy_writer): Invoke ksba_writer_release. Return early
if CTX is NULL.
2006-12-18 Marcus Brinkmann <marcus@g10code.de>
* fingerprint.c (gpgsm_get_fingerprint): Close MD.

View File

@ -92,6 +92,11 @@ struct base64_context_s {
struct reader_cb_parm_s rparm;
struct writer_cb_parm_s wparm;
} u;
union {
ksba_reader_t reader;
ksba_writer_t writer;
} u2;
};
@ -568,6 +573,7 @@ gpgsm_create_reader (Base64Context *ctx,
return rc;
}
(*ctx)->u2.reader = r;
*r_reader = r;
return 0;
}
@ -582,6 +588,10 @@ gpgsm_reader_eof_seen (Base64Context ctx)
void
gpgsm_destroy_reader (Base64Context ctx)
{
if (!ctx)
return;
ksba_reader_release (ctx->u2.reader);
xfree (ctx);
}
@ -630,6 +640,7 @@ gpgsm_create_writer (Base64Context *ctx,
return rc;
}
(*ctx)->u2.writer = w;
*r_writer = w;
return 0;
}
@ -654,5 +665,9 @@ gpgsm_finish_writer (Base64Context ctx)
void
gpgsm_destroy_writer (Base64Context ctx)
{
if (!ctx)
return;
ksba_writer_release (ctx->u2.writer);
xfree (ctx);
}