Skip to content

Commit

Permalink
cg: clear dnp->dn_tstring after freeing it
Browse files Browse the repository at this point in the history
We were freeing the dn_tstring (if any) on a node wothout actually
setting dn_tstring to NULL to prevent any further use.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Eugene Loh <eugene.loh@oracle.com>
  • Loading branch information
kvanhees committed Sep 23, 2023
1 parent d9fefe1 commit 2b53e24
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libdtrace/dt_cg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,8 +1262,10 @@ dt_cg_tstring_free(dt_pcb_t *pcb, dt_node_t *dnp)
case DT_NODE_OP2:
case DT_NODE_OP3:
case DT_NODE_DEXPR:
if (dnp->dn_tstring)
if (dnp->dn_tstring) {
dt_cg_tstring_xfree(pcb, dnp->dn_tstring->dn_value);
dnp->dn_tstring = NULL;
}
}
}

Expand Down

0 comments on commit 2b53e24

Please sign in to comment.