Skip to content

Commit 7de78bf

Browse files
committed
Fix
1 parent 35a6178 commit 7de78bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

agent/lib_aws_sdk_php.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ void nr_aws_lambda_invoke(NR_EXECUTE_PROTO, nr_segment_cloud_attrs_t* cloud_attr
404404
char* qualifier = NULL;
405405
zval* qualifier_zval = NULL;
406406
char* accountID = NULL;
407+
bool using_account_id_ini = false;
407408

408409
/* verify arguments */
409410
if (!nr_php_is_zval_valid_array(call_args)) {
@@ -448,6 +449,7 @@ void nr_aws_lambda_invoke(NR_EXECUTE_PROTO, nr_segment_cloud_attrs_t* cloud_attr
448449
}
449450
if (nr_strempty(accountID)) {
450451
accountID = NRINI(aws_account_id);
452+
using_account_id_ini = true;
451453
}
452454
if (nr_strempty(region)) {
453455
region_zval
@@ -479,7 +481,9 @@ void nr_aws_lambda_invoke(NR_EXECUTE_PROTO, nr_segment_cloud_attrs_t* cloud_attr
479481

480482
nr_regex_substrings_destroy(&matches);
481483
nr_free(function_name);
482-
nr_free(accountID);
484+
if (!using_account_id_ini) {
485+
nr_free(accountID);
486+
}
483487
nr_free(region);
484488
nr_free(qualifier);
485489
nr_php_zval_free(&region_zval);

0 commit comments

Comments
 (0)