diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-12-19 17:27:28 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-12-19 17:27:28 +0200 |
commit | 881a0034f7a93dd19de5fd90c5ad46edc2936c10 (patch) | |
tree | 6828ab6172102b38d1b280cf34f6a40aedcd9581 /lib/rpmfi.c | |
parent | 8becdbfd73d49ca353254d4e40687a9399e240ae (diff) | |
download | librpm-tizen-881a0034f7a93dd19de5fd90c5ad46edc2936c10.tar.gz librpm-tizen-881a0034f7a93dd19de5fd90c5ad46edc2936c10.tar.bz2 librpm-tizen-881a0034f7a93dd19de5fd90c5ad46edc2936c10.zip |
Save some trouble by grabbing malloced copy of dir indexes
Diffstat (limited to 'lib/rpmfi.c')
-rw-r--r-- | lib/rpmfi.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/rpmfi.c b/lib/rpmfi.c index 6661f392f..7aabbda32 100644 --- a/lib/rpmfi.c +++ b/lib/rpmfi.c @@ -767,7 +767,6 @@ Header relocateFileList(const rpmts ts, rpmfi fi, char ** baseNames; char ** dirNames; uint32_t * dirIndexes; - uint32_t * newDirIndexes; rpm_count_t fileCount, dirCount, numValid = 0; rpm_color_t * fColors = NULL; rpm_color_t * dColors = NULL; @@ -941,7 +940,7 @@ assert(p != NULL); } headerGet(h, RPMTAG_BASENAMES, &bnames, fi->scareFlags); - headerGet(h, RPMTAG_DIRINDEXES, &dindexes, fi->scareFlags); + headerGet(h, RPMTAG_DIRINDEXES, &dindexes, HEADERGET_ALLOC); headerGet(h, RPMTAG_DIRNAMES, &dnames, fi->scareFlags); headerGet(h, RPMTAG_FILECOLORS, &fcolors, fi->scareFlags); headerGet(h, RPMTAG_FILEMODES, &fmodes, fi->scareFlags); @@ -958,10 +957,6 @@ assert(p != NULL); dColors = xcalloc(dirCount, sizeof(*dColors)); - newDirIndexes = xmalloc(sizeof(*newDirIndexes) * fileCount); - memcpy(newDirIndexes, dirIndexes, sizeof(*newDirIndexes) * fileCount); - dirIndexes = newDirIndexes; - /* * For all relocations, we go through sorted file/relocation lists * backwards so that /usr/local relocations take precedence over /usr @@ -1188,7 +1183,6 @@ dColors[j] |= fColors[i]; free(relocations[i].newPath); } free(relocations); - free(newDirIndexes); free(dColors); return h; |