File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -197,17 +197,22 @@ NR_PHP_WRAPPER(nr_mongodb_operation_after) {
197
197
.port_path_or_id = NULL ,
198
198
.database_name = NULL ,
199
199
};
200
+
201
+ // tell the compiler to ignore the cast from const char * to char *
202
+ // to save having to do a strdup operation
203
+ #pragma GCC diagnostic push
204
+ #pragma GCC diagnostic ignored "-Wcast-qual"
200
205
nr_segment_datastore_params_t params = {
201
206
.datastore = {
202
207
.type = NR_DATASTORE_MONGODB ,
203
208
},
204
- .operation = nr_strdup ( wraprec -> extra ) ,
209
+ .operation = ( char * ) wraprec -> extra ,
205
210
.instance = & instance ,
206
211
.callbacks = {
207
212
.backtrace = nr_php_backtrace_callback ,
208
213
},
209
214
};
210
-
215
+ #pragma GCC diagnostic pop
211
216
/*
212
217
* We check for the interface all Collection operations extend, rather than
213
218
* their specific class. Not all operations have the properties we need but
@@ -245,7 +250,6 @@ NR_PHP_WRAPPER(nr_mongodb_operation_after) {
245
250
nr_php_scope_release (& this_var );
246
251
nr_free (instance .host );
247
252
nr_free (instance .port_path_or_id );
248
- nr_free (params .operation );
249
253
}
250
254
NR_PHP_WRAPPER_END
251
255
You can’t perform that action at this time.
0 commit comments