Skip to content

Commit

Permalink
clients/upsmon.c: ups_free(): release ups->status_tokens if needed [n…
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov committed Dec 6, 2024
1 parent 9f53fd7 commit 63a4bcc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clients/upsmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2344,6 +2344,14 @@ static void ups_free(utype_t *ups)
free(ups->hostname);
free(ups->un);
free(ups->pw);

/* We usually free and nullify these as we have no use for them,
* but if something remains (had active alert etc.) - do it here: */
if (ups->status_tokens) {
state_infofree(ups->status_tokens);
ups->status_tokens = NULL;
}

free(ups);
}

Expand Down

0 comments on commit 63a4bcc

Please sign in to comment.