@@ -173,29 +173,22 @@ PHP_FUNCTION(newrelic_notice_error) {
173
173
}
174
174
175
175
if (!determine ) {
176
- char * buf = nr_strndup (errormsgstr , errormsglen );
177
176
char * stack_json = nr_php_backtrace_to_json (NULL TSRMLS_CC );
178
177
179
- nr_txn_record_error (NRPRG (txn ), priority , true, buf , errclass , stack_json );
178
+ nr_txn_record_error (NRPRG (txn ), priority , true, errormsgstr , errclass ,
179
+ stack_json );
180
180
181
- nr_free (buf );
182
181
nr_free (stack_json );
183
182
184
183
RETURN_TRUE ;
185
184
}
186
185
if (determine ) {
187
- char * buf1 = nr_strndup (errormsgstr , errormsglen );
188
- char * buf2 = nr_strndup (error_file , error_file_len );
189
- char * buf3 = nr_strndup (error_context , error_context_len );
190
186
char * stack_json = nr_php_backtrace_to_json (NULL TSRMLS_CC );
191
187
192
188
nr_txn_record_error_with_additional_attributes (
193
- NRPRG (txn ), priority , true, buf1 , errclass , buf2 ,
194
- error_line , buf3 , error_number , stack_json );
189
+ NRPRG (txn ), priority , true, errormsgstr , errclass , error_file ,
190
+ error_line , error_context , error_number , stack_json );
195
191
196
- nr_free (buf1 );
197
- nr_free (buf2 );
198
- nr_free (buf3 );
199
192
nr_free (stack_json );
200
193
201
194
RETURN_TRUE ;
0 commit comments