Skip to content

Commit 02c00c9

Browse files
committed
fix(agent): Free values in all cases
1 parent ea34ac0 commit 02c00c9

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

agent/lib_aws_sdk_php.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -666,18 +666,17 @@ void nr_lib_aws_sdk_php_dynamodb_handle(nr_segment_t* auto_segment,
666666
* created segment.
667667
*/
668668
datastore_segment = nr_segment_start(NRPRG(txn), NULL, NULL);
669-
if (NULL == datastore_segment) {
670-
return;
671-
}
672-
/* re-use start time from auto_segment started in func_begin */
673-
datastore_segment->start_time = auto_segment->start_time;
674-
cloud_attrs.aws_operation = command_name_string;
669+
if (NULL != datastore_segment) {
670+
/* re-use start time from auto_segment started in func_begin */
671+
datastore_segment->start_time = auto_segment->start_time;
672+
cloud_attrs.aws_operation = command_name_string;
675673

676-
/* Add cloud attributes, if available. */
677-
nr_segment_traces_add_cloud_attributes(datastore_segment, &cloud_attrs);
674+
/* Add cloud attributes, if available. */
675+
nr_segment_traces_add_cloud_attributes(datastore_segment, &cloud_attrs);
678676

679-
/* Now end the instrumented segment as a message segment. */
680-
nr_segment_datastore_end(&datastore_segment, &datastore_params);
677+
/* Now end the instrumented segment as a message segment. */
678+
nr_segment_datastore_end(&datastore_segment, &datastore_params);
679+
}
681680
nr_free(datastore_params.collection);
682681
nr_free(cloud_attrs.cloud_resource_id);
683682
nr_free(instance.port_path_or_id);

0 commit comments

Comments
 (0)