From c9a5f2bf5bf2309128df30e0af9e558c53222f55 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Tue, 16 Mar 2010 16:51:27 +0000 Subject: [PATCH] fixed mgmt of authz rules --- org.glite.lb.common/src/context.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/org.glite.lb.common/src/context.c b/org.glite.lb.common/src/context.c index 7641ddc..ca3db1c 100644 --- a/org.glite.lb.common/src/context.c +++ b/org.glite.lb.common/src/context.c @@ -597,14 +597,15 @@ edg_wll_add_authz_rule(edg_wll_Context ctx, char *attr_value) { struct _edg_wll_authz_rule *tmp = policy->rules; + int num = policy->num; - tmp = realloc(tmp, (policy->num + 1) * sizeof(*tmp)); + tmp = realloc(tmp, (num + 1) * sizeof(*tmp)); if (tmp == NULL) return edg_wll_SetError(ctx, ENOMEM, NULL);; - tmp->action = action; - tmp->attr_id = attr_id; - tmp->attr_value = strdup(attr_value); + tmp[num].action = action; + tmp[num].attr_id = attr_id; + tmp[num].attr_value = strdup(attr_value); policy->rules = tmp; policy->num++; -- 1.8.2.3