Skip to content

Commit e623e99

Browse files
committed
fix(agent): add dtor closer to init
1 parent 60fd628 commit e623e99

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

agent/lib_php_amqplib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,21 +382,21 @@ static inline void nr_php_amqplib_insert_dt_headers(zval* amqp_msg) {
382382
key_exists
383383
= nr_php_zend_hash_find(HASH_OF(amqp_table_data), ZSTR_VAL(key_str));
384384
if (NULL == key_exists) {
385+
/* Key doesn't exist, so set the value in the AMQPTable. */
386+
385387
/* key_str is a zend_string. It needs to be a zval to pass to
386388
* nr_php_call. */
387389
ZVAL_STR_COPY(&key_zval_zpd, key_str);
388-
/* Key doesn't exist, so set the value in the AMQPTable. */
389390
retval_set_table_zvf
390391
= nr_php_call(amqp_headers_table, "set", &key_zval_zpd, val);
391-
392+
zval_ptr_dtor(&key_zval_zpd);
392393
if (NULL == retval_set_table_zvf) {
393394
nrl_verbosedebug(NRL_INSTRUMENT,
394395
"%s didn't exist in the AMQPTable, but couldn't "
395396
"set the key/val to the table.",
396-
NRSAFESTR(Z_STRVAL(key_zval_zpd)));
397+
NRSAFESTR(ZSTR_VAL(key_str)));
397398
}
398399
nr_php_zval_free(&retval_set_table_zvf);
399-
zval_ptr_dtor(&key_zval_zpd);
400400
}
401401
}
402402
}

0 commit comments

Comments
 (0)