Ack, code review only.
Thanks,
Praveen
On 17-Jun-16 8:56 AM, Gary Lee wrote:
> osaf/libs/common/amf/d2nmsg.c | 1 +
> osaf/services/saf/amf/amfnd/clc.cc | 6 ++++--
> osaf/services/saf/amf/amfnd/sidb.cc | 7 ++++---
> 3 files changed, 9 insertions(+), 5 deletions(-)
>
>
> diff --git a/osaf/libs/common/amf/d2nmsg.c b/osaf/libs/common/amf/d2nmsg.c
> --- a/osaf/libs/common/amf/d2nmsg.c
> +++ b/osaf/libs/common/amf/d2nmsg.c
> @@ -166,6 +166,7 @@ static uint32_t cpy_d2n_susi_msg(AVSV_DN
> malloc(s_compcsi_info->attrs.number *
> sizeof(*d_compcsi_info->attrs.list));
> if (d_compcsi_info->attrs.list == NULL) {
> free_d2n_susi_msg_info(d_susi_msg);
> + free(d_compcsi_info);
> return NCSCC_RC_FAILURE;
> }
> memcpy(d_compcsi_info->attrs.list,
> s_compcsi_info->attrs.list,
> diff --git a/osaf/services/saf/amf/amfnd/clc.cc
> b/osaf/services/saf/amf/amfnd/clc.cc
> --- a/osaf/services/saf/amf/amfnd/clc.cc
> +++ b/osaf/services/saf/amf/amfnd/clc.cc
> @@ -2943,9 +2943,11 @@ uint32_t avnd_comp_clc_cmd_execute(AVND_
> osafassert(csi);
>
> /* allocate additional env_set memory for the CSI
> attributes */
> - env_set =
> static_cast<NCS_OS_ENVIRON_SET_NODE*>(realloc(env_set,
> sizeof(NCS_OS_ENVIRON_SET_NODE) * (env_set_nmemb +
> + NCS_OS_ENVIRON_SET_NODE* tmp = nullptr;
> + tmp =
> static_cast<NCS_OS_ENVIRON_SET_NODE*>(realloc(env_set,
> sizeof(NCS_OS_ENVIRON_SET_NODE) * (env_set_nmemb +
> csi->attrs.number)));
> - osafassert(env_set);
> + osafassert(tmp);
> + env_set = tmp;
>
> /* initialize newly allocated memory */
> memset(&env_set[env_set_nmemb], 0,
> sizeof(NCS_OS_ENVIRON_SET_NODE) * csi->attrs.number);
> diff --git a/osaf/services/saf/amf/amfnd/sidb.cc
> b/osaf/services/saf/amf/amfnd/sidb.cc
> --- a/osaf/services/saf/amf/amfnd/sidb.cc
> +++ b/osaf/services/saf/amf/amfnd/sidb.cc
> @@ -329,8 +329,8 @@ done1:
> AVND_COMP_CSI_REC *avnd_su_si_csi_rec_add(AVND_CB *cb,
> AVND_SU *su, AVND_SU_SI_REC *si_rec,
> AVND_COMP_CSI_PARAM *param, uint32_t *rc)
> {
> - AVND_COMP_CSI_REC *csi_rec = 0;
> - AVND_COMP *comp = 0;
> + AVND_COMP_CSI_REC *csi_rec = nullptr;
> + AVND_COMP *comp = nullptr;
>
> TRACE_ENTER2("Comp'%s', Csi'%s' and Rank'%u'",param->csi_name.value,
> param->comp_name.value, param->csi_rank);
>
> @@ -346,7 +346,7 @@ AVND_COMP_CSI_REC *avnd_su_si_csi_rec_ad
> /* get the comp */
> comp = m_AVND_COMPDB_REC_GET(cb->compdb, param->comp_name);
> if (!comp) {
> - /* This could be becasue of NPI components, NPI components are
> not added in to DB
> + /* This could be because of NPI components, NPI components are
> not added in to DB
> because amfd doesn't send SU presence message to amfnd when
> SU is unlock-in.
> So, add the component into DB now. */
> if (avnd_comp_config_get_su(su) != NCSCC_RC_SUCCESS) {
> @@ -432,6 +432,7 @@ AVND_COMP_CSI_REC *avnd_su_si_csi_rec_ad
>
> err:
> if (csi_rec) {
> + osafassert(comp != nullptr);
> /* remove from comp-csi & si-csi lists */
> ncs_db_link_list_delink(&si_rec->csi_list,
> &csi_rec->si_dll_node);
> m_AVND_COMPDB_REC_CSI_REM(*comp, *csi_rec);
>
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel