X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fyaz-ccl.c;h=f00126d2573b5b330e40b35895abec0951f6eb20;hb=61332f860c40c483d1283532e5fb225daee75e67;hp=a801874c9a8b6537dcd22aacd457d78213875601;hpb=63cafe41a93427118959a74201b3e331169a71d9;p=yaz-moved-to-github.git diff --git a/util/yaz-ccl.c b/util/yaz-ccl.c index a801874..f00126d 100644 --- a/util/yaz-ccl.c +++ b/util/yaz-ccl.c @@ -15,13 +15,13 @@ static Z_AttributesPlusTerm *ccl_rpn_term (struct ccl_rpn_node *p) Odr_oct *term_octet; Z_Term *term; - zapt = malloc (sizeof(*zapt)); + zapt = xmalloc (sizeof(*zapt)); assert (zapt); - term_octet = malloc (sizeof(*term_octet)); + term_octet = xmalloc (sizeof(*term_octet)); assert (term_octet); - term = malloc(sizeof(*term)); + term = xmalloc(sizeof(*term)); assert(term); for (attr = p->u.t.attr_list; attr; attr = attr->next) @@ -30,11 +30,11 @@ static Z_AttributesPlusTerm *ccl_rpn_term (struct ccl_rpn_node *p) if (num) { int i = 0; - zapt->attributeList = malloc (num*sizeof(*zapt->attributeList)); + zapt->attributeList = xmalloc (num*sizeof(*zapt->attributeList)); assert (zapt->attributeList); for (attr = p->u.t.attr_list; attr; attr = attr->next, i++) { - zapt->attributeList[i] = malloc (sizeof(**zapt->attributeList)); + zapt->attributeList[i] = xmalloc (sizeof(**zapt->attributeList)); assert (zapt->attributeList[i]); zapt->attributeList[i]->attributeType = &attr->type; @@ -63,7 +63,7 @@ static Z_Operand *ccl_rpn_simple (struct ccl_rpn_node *p) { Z_Operand *zo; - zo = malloc (sizeof(*zo)); + zo = xmalloc (sizeof(*zo)); assert (zo); switch (p->kind) @@ -87,12 +87,12 @@ static Z_Complex *ccl_rpn_complex (struct ccl_rpn_node *p) Z_Complex *zc; Z_Operator *zo; - zc = malloc (sizeof(*zc)); + zc = xmalloc (sizeof(*zc)); assert (zc); - zo = malloc (sizeof(*zo)); + zo = xmalloc (sizeof(*zo)); assert (zo); - zc->operator = zo; + zc->roperator = zo; switch (p->kind) { case CCL_RPN_AND: @@ -119,7 +119,7 @@ static Z_RPNStructure *ccl_rpn_structure (struct ccl_rpn_node *p) { Z_RPNStructure *zs; - zs = malloc (sizeof(*zs)); + zs = xmalloc (sizeof(*zs)); assert (zs); switch (p->kind) { @@ -145,7 +145,7 @@ Z_RPNQuery *ccl_rpn_query (struct ccl_rpn_node *p) { Z_RPNQuery *zq; - zq = malloc (sizeof(*zq)); + zq = xmalloc (sizeof(*zq)); assert (zq); zq->attributeSetId = NULL; zq->RPNStructure = ccl_rpn_structure (p);