diff options
| author | jvoisin | 2018-01-15 14:56:08 +0100 |
|---|---|---|
| committer | jvoisin | 2018-01-15 14:56:08 +0100 |
| commit | 86b5068496ad86da71e2de4fcb8db0c2347a7f98 (patch) | |
| tree | 365c94a1f614be9ec6ee3f483310d3fa081d1510 /src/sp_cookie_encryption.c | |
| parent | e96eed3a0fda3b3bcb6290a31a80ce6705826728 (diff) | |
Fix some memleaks
Diffstat (limited to 'src/sp_cookie_encryption.c')
| -rw-r--r-- | src/sp_cookie_encryption.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c index 42cac85..29e96b1 100644 --- a/src/sp_cookie_encryption.c +++ b/src/sp_cookie_encryption.c | |||
| @@ -94,7 +94,7 @@ int decrypt_cookie(zval *pDest, int num_args, va_list args, | |||
| 94 | 94 | ||
| 95 | generate_key(key); | 95 | generate_key(key); |
| 96 | 96 | ||
| 97 | decrypted = pecalloc(ZSTR_LEN(debase64), 1, 0); | 97 | decrypted = ecalloc(ZSTR_LEN(debase64), 1); |
| 98 | 98 | ||
| 99 | ret = crypto_secretbox_open( | 99 | ret = crypto_secretbox_open( |
| 100 | decrypted, | 100 | decrypted, |
| @@ -137,8 +137,8 @@ static zend_string *encrypt_data(char *data, unsigned long long data_len) { | |||
| 137 | 137 | ||
| 138 | unsigned char key[crypto_secretbox_KEYBYTES] = {0}; | 138 | unsigned char key[crypto_secretbox_KEYBYTES] = {0}; |
| 139 | unsigned char nonce[crypto_secretbox_NONCEBYTES] = {0}; | 139 | unsigned char nonce[crypto_secretbox_NONCEBYTES] = {0}; |
| 140 | unsigned char *data_to_encrypt = pecalloc(encrypted_msg_len, 1, 0); | 140 | unsigned char *data_to_encrypt = ecalloc(encrypted_msg_len, 1); |
| 141 | unsigned char *encrypted_data = pecalloc(emsg_and_nonce_len, 1, 1); | 141 | unsigned char *encrypted_data = ecalloc(emsg_and_nonce_len, 1); |
| 142 | 142 | ||
| 143 | generate_key(key); | 143 | generate_key(key); |
| 144 | 144 | ||
