Skip to content

Commit

Permalink
review: improve fallback naming
Browse files Browse the repository at this point in the history
  • Loading branch information
bduranleau-nr committed Jan 25, 2025
1 parent aebfeeb commit 04cbaf6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions agent/fw_drupal8.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ NR_PHP_WRAPPER(nr_drupal8_name_the_wt_cached) {
}

if (!NRINI(drupal_page_cache_naming)) {
name = nr_strdup("page_cache");
goto end;
}

Expand All @@ -367,8 +366,6 @@ NR_PHP_WRAPPER(nr_drupal8_name_the_wt_cached) {

if (nr_php_is_zval_non_empty_string(controller)) {
name = nr_strndup(Z_STRVAL_P(controller), Z_STRLEN_P(controller));
} else {
name = nr_strdup("page_cache");
}

end:
Expand All @@ -380,6 +377,9 @@ NR_PHP_WRAPPER(nr_drupal8_name_the_wt_cached) {
* otherwise.
*/
if (retval_ptr && nr_php_is_zval_valid_object(*retval_ptr)) {

Check failure

Code scanning / CodeQL

Redundant null check due to previous dereference High

This null check is redundant because
the value is dereferenced
in any case.
This null check is redundant because
the value is dereferenced
in any case.
This null check is redundant because
the value is dereferenced
in any case.
if (NULL == name) {
name = nr_strdup("page_cache");
}
nr_txn_set_path("Drupal8", NRPRG(txn), name, NR_PATH_TYPE_ACTION,
NR_OK_TO_OVERWRITE);
}
Expand Down

0 comments on commit 04cbaf6

Please sign in to comment.