to fclose a private key file.
git-svn-id: svn://svn.tartarus.org/sgt/putty@3552
cda61777-01e9-0310-a592-
d414129be87e
* key file.
*/
if (fgets(buf, sizeof(buf), fp) && !strcmp(buf, rsa_signature)) {
* key file.
*/
if (fgets(buf, sizeof(buf), fp) && !strcmp(buf, rsa_signature)) {
+ /*
+ * This routine will take care of calling fclose() for us.
+ */
ret = loadrsakey_main(fp, key, FALSE, NULL, passphrase, &error);
goto end;
}
ret = loadrsakey_main(fp, key, FALSE, NULL, passphrase, &error);
goto end;
}
/*
* Otherwise, we have nothing. Return empty-handed.
*/
/*
* Otherwise, we have nothing. Return empty-handed.
*/
error = "not an SSH-1 RSA file";
end:
error = "not an SSH-1 RSA file";
end:
if ((ret != 1) && errorstr)
*errorstr = error;
return ret;
if ((ret != 1) && errorstr)
*errorstr = error;
return ret;
*/
if (fgets(buf, sizeof(buf), fp) && !strcmp(buf, rsa_signature)) {
const char *dummy;
*/
if (fgets(buf, sizeof(buf), fp) && !strcmp(buf, rsa_signature)) {
const char *dummy;
+ /*
+ * This routine will take care of calling fclose() for us.
+ */
return loadrsakey_main(fp, NULL, FALSE, comment, NULL, &dummy);
}
fclose(fp);
return loadrsakey_main(fp, NULL, FALSE, comment, NULL, &dummy);
}
fclose(fp);
}
} else {
error = "not an SSH-1 RSA file";
}
} else {
error = "not an SSH-1 RSA file";
if ((ret != 1) && errorstr)
*errorstr = error;
return ret;
if ((ret != 1) && errorstr)
*errorstr = error;
return ret;