From: Dennis Schafroth Date: Mon, 30 Aug 2010 13:36:23 +0000 (+0200) Subject: Fix: allocating string on odr memory X-Git-Tag: v4.1.0~23 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=e53c4f335802aa7e8d617b4dafc0908bc50cabce;p=yaz-moved-to-github.git Fix: allocating string on odr memory --- diff --git a/src/solr.c b/src/solr.c index 33c81b0..807326e 100644 --- a/src/solr.c +++ b/src/solr.c @@ -135,7 +135,7 @@ static Z_AttributeList *yaz_solr_use_atttribute_create(ODR o, const char *name) elements[0]->value.complex->list = (Z_StringOrNumeric **) odr_malloc(o, 1 * sizeof(Z_StringOrNumeric *)); elements[0]->value.complex->list[0] = (Z_StringOrNumeric *) odr_malloc(o, sizeof(Z_StringOrNumeric)); elements[0]->value.complex->list[0]->which = Z_StringOrNumeric_string; - elements[0]->value.complex->list[0]->u.string = (Z_InternationalString *) name; + elements[0]->value.complex->list[0]->u.string = (Z_InternationalString *) odr_strdup(o, name); elements[0]->value.complex->semanticAction = 0; elements[0]->value.complex->num_semanticAction = 0; attributes->attributes = elements;