Skip to content

Commit 0a97306

Browse files
committed
PHPC-1442: Remove obsolete str_efree macro
1 parent 57a9036 commit 0a97306

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

phongo_compat.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#define HASH_KEY_NON_EXISTENT HASH_KEY_NON_EXISTANT
3939
#endif
4040

41-
#define str_efree(s) efree((char*) s)
42-
4341
#if defined(__GNUC__)
4442
#define ARG_UNUSED __attribute__((unused))
4543
#else

php_phongo.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,23 +2096,23 @@ static mongoc_ssl_opt_t* php_phongo_make_ssl_opt(mongoc_uri_t* uri, zval* zoptio
20962096
static void php_phongo_free_ssl_opt(mongoc_ssl_opt_t* ssl_opt)
20972097
{
20982098
if (ssl_opt->pem_file) {
2099-
str_efree(ssl_opt->pem_file);
2099+
efree((char*) ssl_opt->pem_file);
21002100
}
21012101

21022102
if (ssl_opt->pem_pwd) {
2103-
str_efree(ssl_opt->pem_pwd);
2103+
efree((char*) ssl_opt->pem_pwd);
21042104
}
21052105

21062106
if (ssl_opt->ca_file) {
2107-
str_efree(ssl_opt->ca_file);
2107+
efree((char*) ssl_opt->ca_file);
21082108
}
21092109

21102110
if (ssl_opt->ca_dir) {
2111-
str_efree(ssl_opt->ca_dir);
2111+
efree((char*) ssl_opt->ca_dir);
21122112
}
21132113

21142114
if (ssl_opt->crl_file) {
2115-
str_efree(ssl_opt->crl_file);
2115+
efree((char*) ssl_opt->crl_file);
21162116
}
21172117

21182118
efree(ssl_opt);
@@ -2550,7 +2550,7 @@ static bool phongo_manager_set_auto_encryption_opts(php_phongo_manager_t* manage
25502550
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Expected \"keyVaultNamespace\" encryption option to contain a full collection name");
25512551

25522552
if (pfree) {
2553-
str_efree(key_vault_ns);
2553+
efree(key_vault_ns);
25542554
}
25552555

25562556
goto cleanup;
@@ -2562,7 +2562,7 @@ static bool phongo_manager_set_auto_encryption_opts(php_phongo_manager_t* manage
25622562
efree(coll_name);
25632563

25642564
if (pfree) {
2565-
str_efree(key_vault_ns);
2565+
efree(key_vault_ns);
25662566
}
25672567
}
25682568

@@ -2673,7 +2673,7 @@ static mongoc_client_encryption_opts_t* phongo_clientencryption_opts_from_zval(m
26732673
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Expected \"keyVaultNamespace\" encryption option to contain a full collection name");
26742674

26752675
if (pfree) {
2676-
str_efree(keyvault_namespace);
2676+
efree(keyvault_namespace);
26772677
}
26782678

26792679
goto cleanup;
@@ -2684,7 +2684,7 @@ static mongoc_client_encryption_opts_t* phongo_clientencryption_opts_from_zval(m
26842684
efree(coll_name);
26852685

26862686
if (pfree) {
2687-
str_efree(keyvault_namespace);
2687+
efree(keyvault_namespace);
26882688
}
26892689
}
26902690

@@ -2894,7 +2894,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
28942894
mongoc_client_encryption_encrypt_opts_set_keyaltname(opts, keyaltname);
28952895

28962896
if (pfree) {
2897-
str_efree(keyaltname);
2897+
efree(keyaltname);
28982898
}
28992899
}
29002900

@@ -2907,7 +2907,7 @@ static mongoc_client_encryption_encrypt_opts_t* phongo_clientencryption_encrypt_
29072907
mongoc_client_encryption_encrypt_opts_set_algorithm(opts, algorithm);
29082908

29092909
if (pfree) {
2910-
str_efree(algorithm);
2910+
efree(algorithm);
29112911
}
29122912
}
29132913

src/bson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ static bool php_phongo_bson_state_parse_type(zval* options, const char* name, ph
11371137

11381138
cleanup:
11391139
if (classname_free) {
1140-
str_efree(classname);
1140+
efree(classname);
11411141
}
11421142

11431143
return retval;

0 commit comments

Comments
 (0)