aboutsummaryrefslogtreecommitdiffstats
path: root/gpgmeplug/gpgmeplug.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-07-01 11:36:48 +0000
committerWerner Koch <[email protected]>2002-07-01 11:36:48 +0000
commitd73a0f3c410b22352b7d271a5be63c5623f829b7 (patch)
tree4b912337cfcec34a1ee0114f7021eded7da8c8fb /gpgmeplug/gpgmeplug.c
parentreplace many comment lines by just one single comment (diff)
downloadgpgme-d73a0f3c410b22352b7d271a5be63c5623f829b7.tar.gz
gpgme-d73a0f3c410b22352b7d271a5be63c5623f829b7.zip
* gpgmeplug.c (findCertificates): Reintroduced a free which must
have been removed after my last fix. This avoids a memory leak when a fingerprint was not found. Removed the double loop increment in the code to release the arrays.
Diffstat (limited to '')
-rw-r--r--gpgmeplug/gpgmeplug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gpgmeplug/gpgmeplug.c b/gpgmeplug/gpgmeplug.c
index f681b1ee..538f569e 100644
--- a/gpgmeplug/gpgmeplug.c
+++ b/gpgmeplug/gpgmeplug.c
@@ -2363,6 +2363,7 @@ bool findCertificates( const char* addressee,
break;
}
}
+ free (dn);
}
}
}
@@ -2378,7 +2379,7 @@ bool findCertificates( const char* addressee,
*certificates = xmalloc( sizeof(char) * siz );
memset( *certificates, 0, sizeof(char) * siz );
/* fill the buffer */
- for( iFound=0; iFound < nFound; ++iFound ) {
+ for (iFound=0; iFound < nFound; iFound++) {
if( !iFound )
strcpy(*certificates, DNs[iFound] );
else {
@@ -2388,7 +2389,6 @@ bool findCertificates( const char* addressee,
strcat( *certificates, openBracket );
strcat( *certificates, FPRs[iFound] );
strcat( *certificates, closeBracket );
- ++iFound;
free( DNs[ iFound ] );
free( FPRs[iFound ] );
}