summaryrefslogtreecommitdiff
path: root/ipacm/src/IPACM_Conntrack_NATApp.cpp
diff options
context:
space:
mode:
authorMohammed Javid <mjavid@codeaurora.org>2018-01-22 12:11:41 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-02-28 08:53:20 -0800
commitd009241d864ce4573fc2735c95417b95355a9aa3 (patch)
tree93e3b4b9ba16af951aee1ccd84799b189e648ce6 /ipacm/src/IPACM_Conntrack_NATApp.cpp
parent2697b6b3bed796dd401ace06e7a3efa8ea6be40b (diff)
downloadipacfg-mgr-d009241d864ce4573fc2735c95417b95355a9aa3.tar.gz
ipacm: Fix KW issue
Fix KW issue and remove conditional check which is always true. Change-Id: I902b56c3eab262798813e3c9c6d920665e5ecb99
Diffstat (limited to 'ipacm/src/IPACM_Conntrack_NATApp.cpp')
-rw-r--r--ipacm/src/IPACM_Conntrack_NATApp.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/ipacm/src/IPACM_Conntrack_NATApp.cpp b/ipacm/src/IPACM_Conntrack_NATApp.cpp
index 27bf95a..4004597 100644
--- a/ipacm/src/IPACM_Conntrack_NATApp.cpp
+++ b/ipacm/src/IPACM_Conntrack_NATApp.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -94,11 +94,7 @@ int NatApp::Init(void)
}
memset(pALGPorts, 0, sizeof(ipacm_alg) * nALGPort);
- if(pConfig->GetAlgPorts(nALGPort, pALGPorts) != 0)
- {
- IPACMERR("Unable to retrieve ALG prots\n");
- goto fail;
- }
+ pConfig->GetAlgPorts(nALGPort, pALGPorts);
IPACMDBG("Printing %d alg ports information\n", nALGPort);
for(int cnt=0; cnt<nALGPort; cnt++)
@@ -106,12 +102,23 @@ int NatApp::Init(void)
IPACMDBG("%d: Proto[%d], port[%d]\n", cnt, pALGPorts[cnt].protocol, pALGPorts[cnt].port);
}
}
+ else
+ {
+ IPACMERR("Unable to retrieve ALG prot count\n");
+ goto fail;
+ }
return 0;
fail:
- free(cache);
- free(pALGPorts);
+ if(cache != NULL)
+ {
+ free(cache);
+ }
+ if(pALGPorts != NULL)
+ {
+ free(pALGPorts);
+ }
return -1;
}