Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions php_phongo.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ static zval* phongo_create_implicit_session(zval* manager) /* {{{ */
return NULL;
}

zsession = ecalloc(sizeof(zval), 1);
zsession = ecalloc(1, sizeof(zval));

phongo_session_init(zsession, manager, cs);

Expand Down Expand Up @@ -1234,7 +1234,7 @@ zval* php_phongo_prep_legacy_option(zval* options, const char* key, bool* alloca
*allocated = false;

if (options && Z_TYPE_P(options) != IS_ARRAY) {
zval* new_options = ecalloc(sizeof(zval), 1);
zval* new_options = ecalloc(1, sizeof(zval));

array_init_size(new_options, 1);
add_assoc_zval(new_options, key, options);
Expand Down Expand Up @@ -2368,7 +2368,7 @@ static zval* php_phongo_manager_prepare_manager_for_hash(zval* driverOptions, bo

manager = Z_MANAGER_OBJ_P(keyVaultClient);

driverOptionsClone = ecalloc(sizeof(zval), 1);
driverOptionsClone = ecalloc(1, sizeof(zval));
autoEncryptionOptsClone = &stackAutoEncryptionOptsClone;

ZVAL_DUP(autoEncryptionOptsClone, autoEncryptionOpts);
Expand Down Expand Up @@ -2471,7 +2471,7 @@ static char* php_phongo_concat_handshake_data(const char* default_value, const c
ret_len += custom_value_len + PHONGO_METADATA_SEPARATOR_LEN;
}

ret = ecalloc(sizeof(char*), ret_len);
ret = ecalloc(ret_len, sizeof(char));

if (custom_value) {
snprintf(ret, ret_len, "%s%s%s ", default_value, PHONGO_METADATA_SEPARATOR, custom_value);
Expand All @@ -2491,7 +2491,7 @@ static void php_phongo_handshake_data_append(const char* name, size_t name_len,
char* full_platform;

php_version_string_len = strlen(PHP_VERSION) + PHONGO_METADATA_PHP_VERSION_PREFIX_LEN + 1;
php_version_string = ecalloc(sizeof(char*), php_version_string_len);
php_version_string = ecalloc(php_version_string_len, sizeof(char));
snprintf(php_version_string, php_version_string_len, "%s%s", PHONGO_METADATA_PHP_VERSION_PREFIX, PHP_VERSION);

driver_name = php_phongo_concat_handshake_data("ext-mongodb:PHP", name, name_len);
Expand Down
2 changes: 1 addition & 1 deletion src/bson-encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ void php_phongo_zval_to_bson_value(zval* data, php_phongo_bson_flags_t flags, bs
bson_iter_t iter;
bson_t bson = BSON_INITIALIZER;

zval* data_object = ecalloc(sizeof(zval), 1);
zval* data_object = ecalloc(1, sizeof(zval));

array_init_size(data_object, 1);
add_assoc_zval(data_object, "data", data);
Expand Down