Skip to content

Commit

Permalink
Fixed memory leak in libnl interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
jauge-technica committed Aug 2, 2023
1 parent ce4ed6a commit 3a5a1f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/linux_daemon/mka_phy_driver_libnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,9 @@ t_MKA_result libnl_deinit()
if (my_libnl_status->init_done){
deinit_interface(my_libnl_status);
}
nl_cache_free(my_libnl_status->link_cache);
nl_socket_free(my_libnl_status->nl_sk);
nl_socket_free(my_libnl_status->genl_sk);
nl_cache_free(my_libnl_status->link_cache);
}
return MKA_OK;
}
Expand Down Expand Up @@ -1170,6 +1170,8 @@ t_MKA_result MKA_PHY_UpdateRxSA(t_MKA_bus bus, uint8_t an, t_MKA_pn next_pn, boo
MKA_LOG_DEBUG1("set_receive_lowest_pn -> %d: %d",
an, next_pn);

nlmsg_free(msg);

msg = msg_prepare(bus, MACSEC_CMD_UPD_RXSA, my_libnl_status->ifi);
if (!msg){
MKA_LOG_ERROR("Error on message prepare");
Expand Down

0 comments on commit 3a5a1f4

Please sign in to comment.