leave:
leave: err = 0;
op_sign (void *locusr, const char *inbuf, char **outbuf){    gpgme_error_t err;    gpgme_data_t in=NULL, out=NULL;    gpgme_ctx_t ctx;    struct decrypt_key_s *hd;    *outbuf = NULL;    op_init ();    err = gpgme_new (&ctx);    if (err)	return err;    hd = (struct decrypt_key_s *)xcalloc (1, sizeof *hd);    hd->flags = 0x01;    err = gpgme_data_new_from_mem (&in, inbuf, strlen (inbuf), 1);    if (err)	goto leave;    err = gpgme_data_new (&out);    if (err)	goto leave;        gpgme_set_passphrase_cb (ctx, passphrase_callback_box, hd);    gpgme_signers_add (ctx, (gpgme_key_t)locusr);    gpgme_set_textmode (ctx, 1);    gpgme_set_armor (ctx, 1);    err = gpgme_op_sign (ctx, in, out, GPGME_SIG_MODE_CLEAR);    if (!err) {	size_t n = 0;	*outbuf = gpgme_data_release_and_get_mem (out, &n);	(*outbuf)[n] = 0;	out = NULL;    }leave:    free_decrypt_key (hd);    gpgme_release (ctx);    gpgme_data_release (in);    gpgme_data_release (out);    return 0;}