From 2e2cf0b8f97c8a72255ab0b977f94bd6c684b203 Mon Sep 17 00:00:00 2001 From: Fulup Ar Foll Date: Sun, 5 Nov 2017 13:01:07 +0100 Subject: Added few protection again invalid config --- ahl-policy/ahl-policy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ahl-policy') diff --git a/ahl-policy/ahl-policy.c b/ahl-policy/ahl-policy.c index 78e99ae..4fb75c7 100644 --- a/ahl-policy/ahl-policy.c +++ b/ahl-policy/ahl-policy.c @@ -1183,24 +1183,25 @@ void Policy_Term() g_ptr_array_free(g_PolicyCtx.pHALList,TRUE); g_PolicyCtx.pHALList = NULL; } + - for(int i=0; ilen; i++) + if (g_PolicyCtx.pSourceEndpoints) for(int i=0; ilen; i++) { EndPointPolicyInfoT * pCurEndpoint = &g_array_index(g_PolicyCtx.pSourceEndpoints,EndPointPolicyInfoT,i); g_array_free(pCurEndpoint->streamInfo,TRUE); pCurEndpoint->streamInfo= NULL; } - for(int i=0; ilen; i++) + if (g_PolicyCtx.pSinkEndpoints) for(int i=0; ilen; i++) { EndPointPolicyInfoT * pCurEndpoint = &g_array_index(g_PolicyCtx.pSinkEndpoints,EndPointPolicyInfoT,i); g_array_free(pCurEndpoint->streamInfo,TRUE); pCurEndpoint->streamInfo = NULL; } - g_array_free(g_PolicyCtx.pSourceEndpoints,TRUE); + if (g_PolicyCtx.pSourceEndpoints) g_array_free(g_PolicyCtx.pSourceEndpoints,TRUE); g_PolicyCtx.pSourceEndpoints = NULL; - g_array_free(g_PolicyCtx.pSinkEndpoints,TRUE); + if (g_PolicyCtx.pSinkEndpoints) g_array_free(g_PolicyCtx.pSinkEndpoints,TRUE); g_PolicyCtx.pSinkEndpoints = NULL; } -- cgit 1.2.3-korg