1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-07 23:27:48 +02:00

* gpgkeys_ldap.c (search_key, main): Make sure LDAP values are freed in

case of error.
This commit is contained in:
David Shaw 2002-10-09 02:23:46 +00:00
parent 338aab3be9
commit 63154fea49
2 changed files with 12 additions and 8 deletions

View File

@ -1,5 +1,8 @@
2002-10-08 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_ldap.c (search_key, main): Make sure LDAP values are
freed in case of error.
* gpgkeys_ldap.c (main): Fix error return code.
2002-09-26 Werner Koch <wk@gnupg.org>

View File

@ -352,18 +352,20 @@ int get_key(char *getkey)
/* YYYYMMDDHHmmssZ */
vals=ldap_get_values(ldap,each,"pgpkeycreatetime");
if(vals!=NULL && strlen(vals[0])==15)
if(vals!=NULL)
{
fprintf(console,"Key created:\t%.2s/%.2s/%.4s\n",
&vals[0][4],&vals[0][6],vals[0]);
if(strlen(vals[0])==15)
fprintf(console,"Key created:\t%.2s/%.2s/%.4s\n",
&vals[0][4],&vals[0][6],vals[0]);
ldap_value_free(vals);
}
vals=ldap_get_values(ldap,each,"modifytimestamp");
if(vals!=NULL && strlen(vals[0])==15)
if(vals!=NULL)
{
fprintf(console,"Key modified:\t%.2s/%.2s/%.4s\n",
&vals[0][4],&vals[0][6],vals[0]);
if(strlen(vals[0])==15)
fprintf(console,"Key modified:\t%.2s/%.2s/%.4s\n",
&vals[0][4],&vals[0][6],vals[0]);
ldap_value_free(vals);
}
@ -886,14 +888,13 @@ int main(int argc,char *argv[])
if(vals!=NULL)
{
basekeyspacedn=strdup(vals[0]);
ldap_value_free(vals);
if(basekeyspacedn==NULL)
{
fprintf(console,"gpgkeys: can't allocate string space "
"for LDAP base\n");
goto fail;
}
ldap_value_free(vals);
}
ldap_msgfree(res);