forked from github/server
Bugfix einleseroutine, zu wenig speicher allokiert.
This commit is contained in:
parent
2f447ac0e4
commit
8a8b35e82e
|
@ -386,17 +386,17 @@ tagbegin(struct xml_stack * stack)
|
||||||
}
|
}
|
||||||
} else if (strcmp(tag->name, "maintenance")==0) {
|
} else if (strcmp(tag->name, "maintenance")==0) {
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
const resource_type * rtype;
|
const resource_type * rtype = NULL;
|
||||||
maintenance * mt;
|
maintenance * mt = bt->maintenance;
|
||||||
resource_t type = NORESOURCE;
|
resource_t type = NORESOURCE;
|
||||||
if (bt->maintenance==NULL) {
|
if (mt==NULL) {
|
||||||
mt = bt->maintenance = calloc(sizeof(maintenance), 2);
|
mt = bt->maintenance = calloc(sizeof(struct maintenance), 2);
|
||||||
len = 0;
|
len = 0;
|
||||||
} else {
|
} else {
|
||||||
mt = bt->maintenance;
|
|
||||||
while (mt[len].number) ++len;
|
while (mt[len].number) ++len;
|
||||||
mt = realloc(mt, sizeof(maintenance)*(len+1));
|
mt = bt->maintenance = realloc(mt, sizeof(struct maintenance)*(len+2));
|
||||||
}
|
}
|
||||||
|
fprintf(stderr, "maintenance %s %d %u\n", bt->_name, len, sizeof(maintenance));
|
||||||
mt[len+1].number = 0;
|
mt[len+1].number = 0;
|
||||||
mt[len].number = xml_ivalue(tag, "amount");
|
mt[len].number = xml_ivalue(tag, "amount");
|
||||||
rtype = rt_find(xml_value(tag, "type"));
|
rtype = rt_find(xml_value(tag, "type"));
|
||||||
|
|
Loading…
Reference in New Issue