1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-15 00:02:49 +03:00

fixed memory leak

git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@63 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
cameronrich
2007-02-18 08:14:01 +00:00
parent 61fd249441
commit 900b0eb96e
12 changed files with 100 additions and 84 deletions

View File

@ -52,13 +52,8 @@ int get_file(const char *filename, uint8_t **buf)
int total_bytes = 0;
int bytes_read = 0;
int filesize;
FILE *stream = fopen(filename, "rb");
FILE *stream = ax_fopen(filename, "rb");
if (stream == NULL)
{
return -1;
}
/* Win CE doesn't support stat() */
fseek(stream, 0, SEEK_END);
filesize = ftell(stream);
@ -87,11 +82,7 @@ EXP_FUNC void STDCALL RNG_initialize(const uint8_t *seed_buf, int size)
if (rng_ref_count == 0)
{
#if !defined(WIN32) && defined(CONFIG_USE_DEV_URANDOM)
if ((rng_fd = open("/dev/urandom", O_RDONLY)) < 0)
{
printf(unsupported_str);
exit(1);
}
rng_fd = ax_open("/dev/urandom", O_RDONLY);
#elif defined(WIN32) && defined(CONFIG_WIN32_USE_CRYPTO_LIB)
if (!CryptAcquireContext(&gCryptProv,
NULL, NULL, PROV_RSA_FULL, 0))