X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Freadconfig.c;h=2fe2d7d3f6082bc610e7241f468c18b0f1f83399;hb=f3575c51862ea3ef58aa9acae72505054d510143;hp=bc9329f451ef321dd700b4feaf0cf6d6816c06f0;hpb=4dc39c08f07428ff5f39acd7b0ddee30e0a004f6;p=mmh diff --git a/sbr/readconfig.c b/sbr/readconfig.c index bc9329f..2fe2d7d 100644 --- a/sbr/readconfig.c +++ b/sbr/readconfig.c @@ -52,19 +52,19 @@ readconfig(struct node **npp, FILE *ib, char *file, int ctx) ib)) { case FLD: case FLDPLUS: - np = (struct node *) mh_xmalloc(sizeof(*np)); + np = mh_xcalloc(1, sizeof(*np)); *npp = np; *(npp = &np->n_next) = NULL; - np->n_name = getcpy(name); + np->n_name = mh_xstrdup(name); if (state == FLDPLUS) { - cp = getcpy(field); + cp = mh_xstrdup(field); while (state == FLDPLUS) { state = m_getfld(state, name, field, sizeof(field), ib); cp = add(field, cp); } np->n_field = trimcpy(cp); - free(cp); + mh_free0(&cp); } else { np->n_field = trimcpy(field); }