Skip to content

Commit dd3e314

Browse files
committed
client session BUGFIX double free
Fixes #66
1 parent f952be2 commit dd3e314

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/session_client.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,11 @@ parse_reply(struct ly_ctx *ctx, struct lyxml_elem *xml, struct nc_rpc *rpc, int
12991299
rpc_gen = (struct nc_rpc_act_generic *)rpc;
13001300

13011301
if (rpc_gen->has_data) {
1302-
rpc_act = rpc_gen->content.data;
1302+
rpc_act = lyd_dup(rpc_gen->content.data, 1);
1303+
if (!rpc_act) {
1304+
ERR("Failed to duplicate a generic RPC/action.");
1305+
return NULL;
1306+
}
13031307
} else {
13041308
rpc_act = lyd_parse_mem(ctx, rpc_gen->content.xml_str, LYD_XML, LYD_OPT_RPC | parseroptions, NULL);
13051309
if (!rpc_act) {

0 commit comments

Comments
 (0)