aboutsummaryrefslogtreecommitdiffstats
path: root/acl.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-14 22:28:01 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-14 22:28:01 +0000
commite72e24e0470c97ca6a633445a55ccaa20f0db32e (patch)
tree4034f9af1bd61ecd6709e5d7ec4244fb8dc633b9 /acl.c
parent0993d3ddbf4361d5c28f6552a64f0f203aff8682 (diff)
more memory allocation wrapper conversion (issue #6365)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10066 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'acl.c')
-rw-r--r--acl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/acl.c b/acl.c
index 6061d54c4..2b4e38471 100644
--- a/acl.c
+++ b/acl.c
@@ -113,9 +113,12 @@ static void ast_copy_ha(struct ast_ha *from, struct ast_ha *to)
/* Create duplicate of ha structure */
static struct ast_ha *ast_duplicate_ha(struct ast_ha *original)
{
- struct ast_ha *new_ha = malloc(sizeof(struct ast_ha));
- /* Copy from original to new object */
- ast_copy_ha(original, new_ha);
+ struct ast_ha *new_ha;
+
+ if ((new_ha = ast_malloc(sizeof(*new_ha)))) {
+ /* Copy from original to new object */
+ ast_copy_ha(original, new_ha);
+ }
return new_ha;
}
@@ -144,19 +147,20 @@ struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original)
struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path)
{
- struct ast_ha *ha = malloc(sizeof(struct ast_ha));
+ struct ast_ha *ha;
char *nm = "255.255.255.255";
char tmp[256];
struct ast_ha *prev = NULL;
struct ast_ha *ret;
int x, z;
- unsigned int y;
+ unsigned int y;
+
ret = path;
while (path) {
prev = path;
path = path->next;
}
- if (ha) {
+ if ((ha = ast_malloc(sizeof(*ha)))) {
ast_copy_string(tmp, stuff, sizeof(tmp));
nm = strchr(tmp, '/');
if (!nm) {