avoid another memory leak in checkMessageSignature()
This commit is contained in:
parent
d73a0f3c41
commit
a4b45557ea
@ -2353,7 +2353,7 @@ bool findCertificates( const char* addressee,
|
|||||||
siz += strlen( s2 );
|
siz += strlen( s2 );
|
||||||
siz += strlen( closeBracket );
|
siz += strlen( closeBracket );
|
||||||
DNs[ nFound ] = dn;
|
DNs[ nFound ] = dn;
|
||||||
dn = NULL;
|
dn = NULL; // prevent it from being free'ed below
|
||||||
FPRs[nFound ] = xstrdup( s2 );
|
FPRs[nFound ] = xstrdup( s2 );
|
||||||
++nFound;
|
++nFound;
|
||||||
if( nFound >= MAXCERTS ) {
|
if( nFound >= MAXCERTS ) {
|
||||||
@ -2376,7 +2376,7 @@ bool findCertificates( const char* addressee,
|
|||||||
++siz;
|
++siz;
|
||||||
*newSize = siz;
|
*newSize = siz;
|
||||||
/* allocate the buffer */
|
/* allocate the buffer */
|
||||||
*certificates = xmalloc( sizeof(char) * siz );
|
*certificates = xmalloc( sizeof(char) * siz );
|
||||||
memset( *certificates, 0, sizeof(char) * siz );
|
memset( *certificates, 0, sizeof(char) * siz );
|
||||||
/* fill the buffer */
|
/* fill the buffer */
|
||||||
for (iFound=0; iFound < nFound; iFound++) {
|
for (iFound=0; iFound < nFound; iFound++) {
|
||||||
@ -2451,7 +2451,6 @@ bool checkMessageSignature( char** cleartext,
|
|||||||
GpgmeKey key;
|
GpgmeKey key;
|
||||||
time_t created;
|
time_t created;
|
||||||
struct DnPair* a;
|
struct DnPair* a;
|
||||||
char* dn;
|
|
||||||
int sig_idx=0;
|
int sig_idx=0;
|
||||||
int UID_idx=0;
|
int UID_idx=0;
|
||||||
const char* statusStr;
|
const char* statusStr;
|
||||||
@ -2599,9 +2598,7 @@ bool checkMessageSignature( char** cleartext,
|
|||||||
attr_string = gpgme_key_get_string_attr(key, GPGME_ATTR_USERID, 0, 0);
|
attr_string = gpgme_key_get_string_attr(key, GPGME_ATTR_USERID, 0, 0);
|
||||||
if (attr_string != 0) {
|
if (attr_string != 0) {
|
||||||
a = parse_dn( attr_string );
|
a = parse_dn( attr_string );
|
||||||
dn = reorder_dn( a );
|
sigmeta->extended_info[sig_idx].userid = reorder_dn( a );
|
||||||
storeNewCharPtr( &sigmeta->extended_info[sig_idx].userid,
|
|
||||||
dn );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
attr_ulong = gpgme_key_get_ulong_attr(key, GPGME_ATTR_USERID, 0, 0);
|
attr_ulong = gpgme_key_get_ulong_attr(key, GPGME_ATTR_USERID, 0, 0);
|
||||||
@ -2623,9 +2620,7 @@ bool checkMessageSignature( char** cleartext,
|
|||||||
attr_string = gpgme_key_get_string_attr(key, GPGME_ATTR_NAME, 0, 0);
|
attr_string = gpgme_key_get_string_attr(key, GPGME_ATTR_NAME, 0, 0);
|
||||||
if (attr_string != 0) {
|
if (attr_string != 0) {
|
||||||
a = parse_dn( attr_string );
|
a = parse_dn( attr_string );
|
||||||
dn = reorder_dn( a );
|
sigmeta->extended_info[sig_idx].name = reorder_dn( a );
|
||||||
storeNewCharPtr( &sigmeta->extended_info[sig_idx].name,
|
|
||||||
dn );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* extract email(s) */
|
/* extract email(s) */
|
||||||
|
Loading…
Reference in New Issue
Block a user