From ae286e18432d8cf1e3d0b6ecebdb64a89bc789f0 Mon Sep 17 00:00:00 2001
From: Paul Cadach <paul@odt.east.telecom.kz>
Date: Thu, 18 Jan 2007 06:59:22 +0000
Subject: [PATCH] Update ast_append_ha() usage

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_h323.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 096e8ddbc0..ef099eb527 100644
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -1425,7 +1425,11 @@ static struct oh323_user *build_user(char *name, struct ast_variable *v, struct
 			}
 		} else if (!strcasecmp(v->name, "permit") ||
 					!strcasecmp(v->name, "deny")) {
-			user->ha = ast_append_ha(v->name, v->value, user->ha, NULL);
+			int ha_error = 0;
+
+			user->ha = ast_append_ha(v->name, v->value, user->ha, &ha_error);
+			if (ha_error)
+				ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
 		}
 	}
 	if (!user->options.dtmfmode)
@@ -1529,7 +1533,11 @@ static struct oh323_peer *build_peer(const char *name, struct ast_variable *v, s
 			peer->addr.sin_port = htons(atoi(v->value));
 		} else if (!strcasecmp(v->name, "permit") ||
 					!strcasecmp(v->name, "deny")) {
-			peer->ha = ast_append_ha(v->name, v->value, peer->ha);
+			int ha_error = 0;
+
+			peer->ha = ast_append_ha(v->name, v->value, peer->ha, &ha_error);
+			if (ha_error)
+				ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
 		} else if (!strcasecmp(v->name, "mailbox")) {
 			ast_copy_string(peer->mailbox, v->value, sizeof(peer->mailbox));
 		}
-- 
GitLab