Skip to content

Commit

Permalink
[WIP] Fix more leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
nichamon committed Aug 31, 2023
1 parent 377934f commit 351feaf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ldms/src/ldmsd/ldmsd_failover.c
Original file line number Diff line number Diff line change
Expand Up @@ -2134,6 +2134,9 @@ int failover_cfgprdcr_handler(ldmsd_req_ctxt_t req)
if (perm)
free(perm);
free(stream);
free(auth);
free(rail_s);
free(credits_s);
/* this req needs no resp */
return rc;
}
Expand Down Expand Up @@ -2260,6 +2263,7 @@ int failover_cfgupdtr_handler(ldmsd_req_ctxt_t req)
free(gid);
if (perm)
free(perm);
free(auto_interval);
/* this req need no resp */
return rc;
}
Expand Down
5 changes: 4 additions & 1 deletion ldms/src/ldmsd/ldmsd_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -1498,7 +1498,7 @@ static int prdcr_add_handler(ldmsd_req_ctxt_t reqc)
char *perm_s = NULL;

reqc->errcode = 0;
name = host = xprt = type_s = port_s = interval_s = auth = NULL;
name = host = xprt = type_s = port_s = interval_s = auth = rail_s = credits_s = NULL;

attr_name = "name";
name = ldmsd_req_attr_str_value_get_by_id(reqc, LDMSD_ATTR_NAME);
Expand Down Expand Up @@ -1655,6 +1655,8 @@ static int prdcr_add_handler(ldmsd_req_ctxt_t reqc)
free(xprt);
free(perm_s);
free(auth);
free(rail_s);
free(credits_s);
return 0;
}

Expand Down Expand Up @@ -2274,6 +2276,7 @@ static int prdcr_status_handler(ldmsd_req_ctxt_t reqc)
"prdcr '%s' doesn't exist.", name);
reqc->errcode = ENOENT;
ldmsd_send_req_response(reqc, reqc->line_buf);
free(name);
return 0;
}
}
Expand Down

0 comments on commit 351feaf

Please sign in to comment.