Skip to content

Commit

Permalink
fix free of uninit pointer in json sampler callback
Browse files Browse the repository at this point in the history
  • Loading branch information
baallan authored and tom95858 committed Dec 3, 2024
1 parent ffd70a8 commit fd18926
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ldms/src/sampler/json/json_stream_sampler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ static int json_recv_cb(ldmsd_stream_client_t c, void *ctxt,
struct rbn *rbn;
ldms_set_t l_set;
js_set_t j_set;
char *inst_name = NULL;

LDEBUG("thread: %lu, stream: '%s', msg: '%s'\n", pthread_self(), js->stream_name, msg);
if (stream_type != LDMSD_STREAM_JSON) {
Expand Down Expand Up @@ -1098,7 +1099,7 @@ static int json_recv_cb(ldmsd_stream_client_t c, void *ctxt,
SAMP, rc, msg);
goto err_0;
}
char *inst_name = get_inst_name(js, entity, j_schema, 0, 0, 0);
inst_name = get_inst_name(js, entity, j_schema, 0, 0, 0);
if (!inst_name) {
LERROR("Error %d constructing set name from instance format '%s'.\n",
errno, js->inst_fmt);
Expand Down

0 comments on commit fd18926

Please sign in to comment.