diff options
| author | Pierre Joye <pajoye@php.net> | 2010-06-02 15:27:38 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2010-06-02 15:27:38 +0000 |
| commit | b03678348c43797f74a8097933a958cc300609ae (patch) | |
| tree | 51faafc7da5782edfc5dfe6a7621c2eba0bfe6f0 /ext/mcrypt | |
| parent | 99da695ec90890c3de9d4ae17c2e26133ab9bdc4 (diff) | |
| download | php-git-b03678348c43797f74a8097933a958cc300609ae.tar.gz | |
- fix leak on error in mcrypt_create_iv on windows
Diffstat (limited to 'ext/mcrypt')
| -rw-r--r-- | ext/mcrypt/mcrypt.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 23c8eeb149..b3c711b529 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -1398,10 +1398,12 @@ PHP_FUNCTION(mcrypt_create_iv) /* It could be done using LoadLibrary but as we rely on 2k+ for 5.3, cleaner to use a clear dependency (Advapi32) and a standard API call (no f=getAddr..; f();) */ if(!CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { + efree(iv); php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot open random device"); RETURN_FALSE; } if(!CryptGenRandom(hCryptProv, size, iv_b)) { + efree(iv); php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not gather sufficient random data"); RETURN_FALSE; } |
