improce memory handling
This commit is contained in:
parent
9f84291722
commit
cfcac3496a
@ -967,8 +967,9 @@ bool decryptMessage( const char* ciphertext,
|
|||||||
const char* certificate )
|
const char* certificate )
|
||||||
{
|
{
|
||||||
GpgmeCtx ctx;
|
GpgmeCtx ctx;
|
||||||
|
GpgmeError err;
|
||||||
GpgmeData gCiphertext, gPlaintext;
|
GpgmeData gCiphertext, gPlaintext;
|
||||||
size_t rCLen;
|
size_t rCLen = 0;
|
||||||
char* rCiph = 0;
|
char* rCiph = 0;
|
||||||
bool bOk = false;
|
bool bOk = false;
|
||||||
|
|
||||||
@ -984,6 +985,19 @@ bool decryptMessage( const char* ciphertext,
|
|||||||
struct passphrase_cb_info_s info;
|
struct passphrase_cb_info_s info;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if( !ciphertext )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
err = gpgme_new (&ctx);
|
||||||
|
gpgme_set_protocol (ctx, GPGMEPLUG_PROTOCOL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
temporary code!!
|
temporary code!!
|
||||||
|
|
||||||
@ -999,7 +1013,7 @@ bool decryptMessage( const char* ciphertext,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
gpgme_new( &ctx );
|
|
||||||
gpgme_data_new_from_mem( &gCiphertext, ciphertext,
|
gpgme_data_new_from_mem( &gCiphertext, ciphertext,
|
||||||
1+strlen( ciphertext ), 1 );
|
1+strlen( ciphertext ), 1 );
|
||||||
gpgme_data_new( &gPlaintext );
|
gpgme_data_new( &gPlaintext );
|
||||||
|
Loading…
Reference in New Issue
Block a user