From: Daniel KouĊ™il Date: Tue, 16 Mar 2010 16:51:27 +0000 (+0000) Subject: fixed mgmt of authz rules X-Git-Tag: glite-jobid-api-c_R_1_0_2_1~94 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=c9a5f2bf5bf2309128df30e0af9e558c53222f55;p=jra1mw.git fixed mgmt of authz rules --- 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++;