- [test suite] Bug fix on Mac OS X systems to account for libfko.dylib path
instead of libfko.so. This fixes the existence check for libfko.
- [test suite] Added tests for --nat-local mode.
+ - [client] Fixed several minor memory leaks caught by valgrind.
- Minor gcc warning fix: fko_decode.c:43:17: warning: variable ‘edata_size’
set but not used [-Wunused-but-set-variable].
fprintf(stdout, "fwknop client %s, FKO protocol version %s\n",
MY_VERSION, version);
+ fko_destroy(ctx);
return(EXIT_SUCCESS);
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_spa_client_timeout", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_spa_message_type", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_timestamp", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_timestamp", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
*/
if (options.resolve_ip_http)
if(resolve_ip_http(&options) < 0)
+ {
+ fko_destroy(ctx);
return(EXIT_FAILURE);
+ }
/* Set a message string by combining the allow IP and the
* port/protocol. The fwknopd server allows no port/protocol
if(res != FKO_SUCCESS)
{
errmsg("fko_set_spa_message", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_nat_access_str", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_username", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_spa_encryption_type", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_gpg_home_dir", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
if(IS_GPG_ERROR(res))
fprintf(stderr, "GPG ERR: %s\n", fko_gpg_errstr(ctx));
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
if(IS_GPG_ERROR(res))
fprintf(stderr, "GPG ERR: %s\n", fko_gpg_errstr(ctx));
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_spa_digest_type", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
}
if(IS_GPG_ERROR(res))
fprintf(stderr, "GPG ERR: %s\n", fko_gpg_errstr(ctx));
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
if(res < 0)
{
fprintf(stderr, "send_spa_packet: packet not sent.\n");
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
else
if(res != FKO_SUCCESS)
{
errmsg("fko_get_spa_data", res);
+ fko_destroy(ctx);
return(EXIT_FAILURE);
}
if(res != FKO_SUCCESS)
{
errmsg("fko_new_with_data", res);
+ fko_destroy(ctx);
+ fko_destroy(ctx2);
return(EXIT_FAILURE);
}
if(res != FKO_SUCCESS)
{
errmsg("fko_set_gpg_home_dir", res);
+ fko_destroy(ctx);
+ fko_destroy(ctx2);
return(EXIT_FAILURE);
}
}
debugging purposes. */
fprintf(stderr, "GPG ERR: %s\n%s\n", fko_gpg_errstr(ctx2),
"No access to recipient private key?\n");
+ fko_destroy(ctx);
+ fko_destroy(ctx2);
return(EXIT_SUCCESS);
}
+ fko_destroy(ctx);
+ fko_destroy(ctx2);
return(EXIT_FAILURE);
}