diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-07-02 07:35:50 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-07-02 07:35:50 +0000 |
commit | 38737d4dd629b40d46d7482e916bc67ff0e82182 (patch) | |
tree | f468d15aa99f43868ff1f126ab5d719dc2d63853 | |
parent | 8056ffb747d9fdcc539b6fa54f74c2a98f237fd1 (diff) | |
parent | 3474861c40896e78d7535f6830d66c014e63138a (diff) | |
download | ipacfg-mgr-38737d4dd629b40d46d7482e916bc67ff0e82182.tar.gz |
release-request-d9dc98f7-19b2-484c-b4d1-f35dc43e9c05-for-git_oc-mr1-release-4152006 snap-temp-L91700000079405440
Change-Id: I5a926554a157431daea3aa29808d5482619ca0ff
-rw-r--r-- | msm8998/ipacm/src/IPACM_ConntrackClient.cpp | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/msm8998/ipacm/src/IPACM_ConntrackClient.cpp b/msm8998/ipacm/src/IPACM_ConntrackClient.cpp index 8cc3407..10154ea 100644 --- a/msm8998/ipacm/src/IPACM_ConntrackClient.cpp +++ b/msm8998/ipacm/src/IPACM_ConntrackClient.cpp @@ -598,28 +598,43 @@ void IPACM_ConntrackClient::UNRegisterWithConnTrack(void) IPACMDBG("\n"); + pClient = IPACM_ConntrackClient::GetInstance(); + if(pClient == NULL) + { + IPACMERR("unable to retrieve instance of conntrack client\n"); + return; + } + /* destroy the TCP filter.. this will not detach the filter */ - nfct_filter_destroy(pClient->tcp_filter); - pClient->tcp_filter = NULL; + if (pClient->tcp_filter) { + nfct_filter_destroy(pClient->tcp_filter); + pClient->tcp_filter = NULL; + } /* de-register the callback */ - nfct_callback_unregister(pClient->tcp_hdl); - /* close the handle */ - nfct_close(pClient->tcp_hdl); - pClient->tcp_hdl = NULL; + if (pClient->tcp_hdl) { + nfct_callback_unregister(pClient->tcp_hdl); + /* close the handle */ + nfct_close(pClient->tcp_hdl); + pClient->tcp_hdl = NULL; + } /* destroy the filter.. this will not detach the filter */ - nfct_filter_destroy(pClient->udp_filter); - pClient->udp_filter = NULL; + if (pClient->udp_filter) { + nfct_filter_destroy(pClient->udp_filter); + pClient->udp_filter = NULL; + } /* de-register the callback */ - nfct_callback_unregister(pClient->udp_hdl); - /* close the handle */ - nfct_close(pClient->udp_hdl); - pClient->udp_hdl = NULL; + if (pClient->udp_hdl) { + nfct_callback_unregister(pClient->udp_hdl); + /* close the handle */ + nfct_close(pClient->udp_hdl); + pClient->udp_hdl = NULL; + } - pClient->fd_tcp = 0; - pClient->fd_udp = 0; + pClient->fd_tcp = -1; + pClient->fd_udp = -1; return; } |