mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
FS-11691 [core] fix switch_log_node_dup() so that it completely duplicates log nodes
This commit is contained in:
parent
3d8e54e6f8
commit
10f642249e
@ -108,15 +108,21 @@ SWITCH_DECLARE(switch_log_node_t *) switch_log_node_dup(const switch_log_node_t
|
|||||||
switch_log_node_t *newnode = switch_log_node_alloc();
|
switch_log_node_t *newnode = switch_log_node_alloc();
|
||||||
|
|
||||||
*newnode = *node;
|
*newnode = *node;
|
||||||
|
newnode->content = NULL;
|
||||||
|
|
||||||
if (!zstr(node->data)) {
|
if (node->data) {
|
||||||
newnode->data = strdup(node->data);
|
newnode->data = strdup(node->data);
|
||||||
switch_assert(node->data);
|
switch_assert(newnode->data);
|
||||||
|
|
||||||
|
// content is a pointer inside data; need to calculate the new pointer
|
||||||
|
if (node->content && node->content >= node->data) {
|
||||||
|
newnode->content = newnode->data + (node->content - node->data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!zstr(node->userdata)) {
|
if (node->userdata) {
|
||||||
newnode->userdata = strdup(node->userdata);
|
newnode->userdata = strdup(node->userdata);
|
||||||
switch_assert(node->userdata);
|
switch_assert(newnode->userdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
return newnode;
|
return newnode;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user