mirror of
https://github.com/php-gnupg/php-gnupg.git
synced 2024-11-22 06:27:08 +00:00
Remove hack for PHP 4 in freeing encryptkeys and fix CS
This commit is contained in:
parent
2b3d5b5a29
commit
3bb4d28798
1 changed files with 2 additions and 6 deletions
6
gnupg.c
6
gnupg.c
|
@ -91,11 +91,7 @@ static void php_gnupg_free_encryptkeys(PHPC_THIS_DECLARE(gnupg) TSRMLS_DC)
|
||||||
for (idx = 0; idx < PHPC_THIS->encrypt_size; idx++) {
|
for (idx = 0; idx < PHPC_THIS->encrypt_size; idx++) {
|
||||||
gpgme_key_unref(PHPC_THIS->encryptkeys[idx]);
|
gpgme_key_unref(PHPC_THIS->encryptkeys[idx]);
|
||||||
}
|
}
|
||||||
/* it's an odd-thing, but other solutions makes problems :
|
efree(PHPC_THIS->encryptkeys);
|
||||||
* erealloc(x,0) gives a segfault with PHP 4 and debug enabled
|
|
||||||
* efree(x) alone ends in a segfault
|
|
||||||
*/
|
|
||||||
efree(erealloc(PHPC_THIS->encryptkeys, 0));
|
|
||||||
PHPC_THIS->encryptkeys = NULL;
|
PHPC_THIS->encryptkeys = NULL;
|
||||||
PHPC_THIS->encrypt_size = 0;
|
PHPC_THIS->encrypt_size = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue