rpmfcAttr *atypes; /*!< known file attribute types */
- ARGV_t fn; /*!< (no. files) file names */
+ char ** fn; /*!< (no. files) file names */
ARGV_t *fattrs; /*!< (no. files) file attribute tokens */
ARGI_t fcolor; /*!< (no. files) file colors */
ARGI_t fcdictx; /*!< (no. files) file class dictionary indices */
rpmfcAttrFree(*attr);
free(fc->atypes);
free(fc->buildRoot);
- argvFree(fc->fn);
- for (int i = 0; i < fc->nfiles; i++)
+ for (int i = 0; i < fc->nfiles; i++) {
+ free(fc->fn[i]);
argvFree(fc->fattrs[i]);
+ }
+ free(fc->fn);
free(fc->fattrs);
argiFree(fc->fcolor);
argiFree(fc->fcdictx);
int ix;
/* Generate package and per-file dependencies. */
- for (fc->ix = 0; fc->fn != NULL && fc->fn[fc->ix] != NULL; fc->ix++) {
+ for (fc->ix = 0; fc->ix < fc->nfiles && fc->fn[fc->ix] != NULL; fc->ix++) {
for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) {
rpmfcHelperProvides(fc, *fattr);
rpmfcHelperRequires(fc, *fattr);
}
fc->nfiles = argvCount(argv);
+ fc->fn = xcalloc(fc->nfiles, sizeof(*fc->fn));
fc->fattrs = xcalloc(fc->nfiles, sizeof(*fc->fattrs));
/* Initialize the per-file dictionary indices. */
rpmlog(RPMLOG_DEBUG, "%s: %s\n", s, ftype);
/* Save the path. */
- argvAdd(&fc->fn, s);
+ fc->fn[fc->ix] = xstrdup(s);
/* Add (filtered) file coloring */
fcolor |= rpmfcColor(ftype);