Skip to content

Commit

Permalink
Merge pull request #243 from dirkmueller/master
Browse files Browse the repository at this point in the history
Avoid double free on deinit_thermal()
  • Loading branch information
liuchao173 authored Oct 26, 2022
2 parents 014765d + b25b1f9 commit 5b5be33
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,14 @@ static gboolean set_netlink_nonblocking(void)

void deinit_thermal(void)
{
nl_cb_put(callback);
nl_socket_free(sock);
if (callback) {
nl_cb_put(callback);
callback = NULL;
}
if (sock) {
nl_socket_free(sock);
sock = NULL;
}
}

/*
Expand Down

0 comments on commit 5b5be33

Please sign in to comment.